题目内容

已知定义 int a=1,b=2,c=3;则表达式a>b?(a>c?a:c):b的值为( )。

A. 1
B. 2
C. 3
D. 不确定

查看答案
更多问题

以下程序的运行结果是( )。#include using namespace std;int main(){int x=1; switch(x) {case 1:++x; case 0:--x; default: x+=7; } cout << x << endl; return 0;}

A. 2
B. 1
C. 7
D. 8

运行以下程序,若输入China#<回车>,则输出结果为( )。#include using namespace std;int main(){int c1=0,c2=0; char ch;while ((ch=getchar())!='#')switch (ch){ case 'a':case 'h':c2++;default: c1++;}cout << c1 << "," << c2 << endl;return 0;}

A. 2,0
B. 5,0
C. 5,5
D. 5,2

以下程序中,while循环的的循环次数为( )。#include using namespace std;int main(){int i=0; while (i<10) {if (i<10) continue; if (i==5) break; i++; } return 0;}

A. 1
B. 10
C. 6
D. 死循环,不能确定次数

下列程序运行后的输出结果是( )。#include using namespace std;int main(){int x,y,z; for (x=0;x<=3;x++) z=x; for (y=5;y>=1;y--) z+=y; cout << z << endl; return 0;}

A. 15
B. 16
C. 17
D. 18

答案查题题库