Diễn đàn công nghệ & giải trí
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.

Diễn đàn công nghệ & giải trí

Diễn đàn công nghệ - học tập & giải trí lớp 09tc trường Đại Học Khoa Học Tự Nhiên
 
Trang ChínhPortalTìm kiếmLatest imagesĐăng kýĐăng Nhập
Top posters
12betvn (762)
code C++ demo week05 Vote_lcapcode C++ demo week05 Voting_barcode C++ demo week05 Vote_rcap 
Phạm Quang Nam (705)
code C++ demo week05 Vote_lcapcode C++ demo week05 Voting_barcode C++ demo week05 Vote_rcap 
Nguyên An (674)
code C++ demo week05 Vote_lcapcode C++ demo week05 Voting_barcode C++ demo week05 Vote_rcap 
mmmmaabb012 (160)
code C++ demo week05 Vote_lcapcode C++ demo week05 Voting_barcode C++ demo week05 Vote_rcap 
dragon0388 (140)
code C++ demo week05 Vote_lcapcode C++ demo week05 Voting_barcode C++ demo week05 Vote_rcap 
anhtraidalat (139)
code C++ demo week05 Vote_lcapcode C++ demo week05 Voting_barcode C++ demo week05 Vote_rcap 
NguyenHuuHung (125)
code C++ demo week05 Vote_lcapcode C++ demo week05 Voting_barcode C++ demo week05 Vote_rcap 
fly1571988 (117)
code C++ demo week05 Vote_lcapcode C++ demo week05 Voting_barcode C++ demo week05 Vote_rcap 
giaquynh.nguyen (108)
code C++ demo week05 Vote_lcapcode C++ demo week05 Voting_barcode C++ demo week05 Vote_rcap 
playback (103)
code C++ demo week05 Vote_lcapcode C++ demo week05 Voting_barcode C++ demo week05 Vote_rcap 

Share|

code C++ demo week05

Xem chủ đề cũ hơn Xem chủ đề mới hơn Go down
Tác giảThông điệp
thachbui
Tri Phủ
Tri Phủ
thachbui

Tổng số bài gửi : 51
Experience : 63
Danh Vọng : 0

code C++ demo week05 Empty
Bài gửiTiêu đề: code C++ demo week05 code C++ demo week05 EmptyWed Jan 12, 2011 7:15 pm

main.cpp
Code:

#include "chuoi.h"
#include <iostream>
using namespace std;
void main()
{
   chuoi s;
   bool kq = s.rong();
   if(kq == true)
   {
      cout << "chuoi rong" << endl;
   }
   else
   {
      cout << "khac rong" << endl;
   }
}
chuoi.cpp
Code:

#include "chuoi.h"

bool chuoi::rong()
{
   bool kq = true;
   if(this->chieu_dai == 0)
   {
      kq = true;
   }
   else
   {
      kq = false;
   }
   return kq;
}

chuoi::chuoi()
{
   this->chieu_dai=0;
}
chuoi.h
Code:

class chuoi
{
   // cac thuoc tinh
   private :
      char a[256];
      int chieu_dai;
   //cac phuong thuc
   public :
      bool rong(); // kiem tra chuoi rong
      chuoi();
};
Về Đầu Trang Go down
trexanh078
Dân nhập cư - Chưa có hộ khẩu
Dân nhập cư - Chưa có hộ khẩu


Tổng số bài gửi : 8
Experience : 11
Danh Vọng : 0

code C++ demo week05 Empty
Bài gửiTiêu đề: Re: code C++ demo week05 code C++ demo week05 EmptyTue Aug 16, 2011 12:47 am

moi nguoi giai thich minh cac lenh nay voi

#include "contiki.h"
#include "lib/sensors.h"
#include "dev/sky-sensors.h"
#include "dev/light-sensor.h"

#include <io.h>

/* Photodiode 1 (P64) on INCH_4 */
/* Photodiode 2 (P65) on INCH_5 */
#define INPUT_CHANNEL ((1 << INCH_4) | (1 << INCH_5))
#define INPUT_REFERENCE SREF_0
#define PHOTOSYNTHETIC_MEM ADC12MEM4
#define TOTAL_SOLAR_MEM ADC12MEM5

const struct sensors_sensor light_sensor;

/*---------------------------------------------------------------------------*/
static int
value(int type)
{
switch(type) {
/* Photosynthetically Active Radiation. */
case LIGHT_SENSOR_PHOTOSYNTHETIC:
return PHOTOSYNTHETIC_MEM;

/* Total Solar Radiation. */
case LIGHT_SENSOR_TOTAL_SOLAR:
return TOTAL_SOLAR_MEM;
}
return 0;
}
/*---------------------------------------------------------------------------*/
static int
status(int type)
{
return sky_sensors_status(INPUT_CHANNEL, type);
}
/*---------------------------------------------------------------------------*/
static int
configure(int type, int c)
{
return sky_sensors_configure(INPUT_CHANNEL, INPUT_REFERENCE, type, c);
}
/*---------------------------------------------------------------------------*/
SENSORS_SENSOR(light_sensor, "Light", value, configure, status);
Về Đầu Trang Go down

code C++ demo week05

Xem chủ đề cũ hơn Xem chủ đề mới hơn Về Đầu Trang
Trang 1 trong tổng số 1 trang

Permissions in this forum:Bạn không có quyền trả lời bài viết
Diễn đàn công nghệ & giải trí :: Chuyên mục Công Nghệ Thông Tin :: Thủ thuật lập trình, Mã nguồn-
Free forum | ©phpBB | Free forum support | Báo cáo lạm dụng | Thảo luận mới nhất
quan ao tre em | thoi trang tre em | thoi trang be gai | thoi trang be trai | me va be | ao khoac cho be