Professional Documents
Culture Documents
Bool B B 0 Cout B Endl B b-1 Cout B Endl B b-1 Cout B Endl B B +1 Cout B Endl B B +1 Cout B Endl
Bool B B 0 Cout B Endl B b-1 Cout B Endl B b-1 Cout B Endl B B +1 Cout B Endl B B +1 Cout B Endl
1. 撰寫下列程式,請寫出輸出內容,合理嗎?請解釋。
bool b;
2. 撰寫下列程式,請寫出輸出內容,合理嗎?請解釋。
char b;
b = '5'; cout << b << endl;
b = b-1; cout << b << endl;
b = b-2; cout << b << endl;
b = b+4; cout << b << endl;
3. 撰寫下列程式,請寫出輸出內容,合理嗎?請解釋。
short b;
b = '5'; cout << b << endl;
b = b-1; cout << b << endl;
b = b-2; cout << b << endl;
b = b+4; cout << b << endl;
b = 'C'; cout << b << endl;
b = b-1; cout << b << endl;
b = b-200; cout << b << endl;
b = b+400; cout << b << endl;