//testcpp.cpp -- by tsaiwn@csie.nctu.edu.tw // g++ testcpp.cpp // true in C++ is actually 1 // false in C++ is actually 0 #include #include using namespace std; // 用新寫法就要這樣 int main( ) { bool t = true; cout << " t === " << t << endl; printf(" t=%d\n", t); cout << " now doing ... t = false; \n"; t = false; cout << " t === " << t << endl; printf(" t=%d\n", t); return 0; // C/C++ 規定要這樣 }