close
think:
A ? " 1 " : " 0 "
如果A執行完的結果是true or 1則reture A ? " 1 " : " 0 "
的前項
如果A執行完的結果是false or 0則reture A ? " 1 " : " 0 "
的後項
題目: 輸出結果是什麼?
程式碼:
// What does this program print?
#include <iostream>
using std::cout;
using std::endl;
int main()
{
int i = 1;
while ( i <= 5 )
{
// output line of text
cout << ( i % 2 ? "~~ I am true!!!~~" : " ~~I am false!!!~~" ) << endl;
++i;
}
return 0;
}
顯示結果:
全站熱搜
留言列表