题目内容

下面程序执行后的输出结果是 。 #include< iostream> #include using namespace std;void main(){char str[]="SSWLIA",c; int k;for (k =1;(c=str[k])!='\0';k++) {switch (c) {case 'I':++k; break;case 'L':continue;default: cout << c; continue;}cout << '*';}}

A. SSW
B. SW*
C. SW*A
D. SW

查看答案
更多问题

下面程序执行后的输出结果是 。#include< iostream> #include using namespace std;void main(){int a[3][3] = { { 1, 2 }, { 3, 4 }, { 5, 6 } }, i, j, s = 0;for (i = 1; i < 3; i++)for (j = 0; j <= i; j++) s += a[i][j];cout << s;}

A. 18
B. 19
C. 20
D. 21

下面程序执行后的输出结果是 。#include< iostream> #include using namespace std;void main(){char w[][10] = { "ABCD", "EFGH", "IJKL", "MNOP" }, k;for (k = 1; k < 3; k++) cout << w[k];}

ABCDFGHKL
B. ABCDEFGIJM
C. EFGJKO
D. EFGHIJKL

设有数组A[i][j],数组的每个元素长度为3字节,i的值为1~8,j的值为1~10, 数组从内存首地址BA开始顺序存放,当以列为主存放时,元素A[5][8]的存储首地址为 。

A. BA+141
BA+l80
C. BA+222
D. BA+225

下面程序执行后的输出结果是 。#include< iostream> using namespace std;void swapl(int c[]){int t;t = c[0]; c[0] = c[1]; c[1] = t;}void swap2(int c0, int cl){int t;t = c0; c0 = cl; cl = t;}void main(){int a[2] = { 3, 5 }, b[2] = { 3, 5 };swapl(a); swap2(b[0], b[1]);cout << a[0] << a[1] << b[0] << b[1];}

A. 5353
B. 5335
C. 3535
D. 3553

答案查题题库