17.下面程序运行时输出的结果是()。
#include
int main()
{ int m=5, n=0;
while(m>0)
{switch( )
{case 1:
case 3:n+=1; m--; break;
default:n=0;m--;
case 2:
case 4: n+=2; m--; break;
}
printf("%2d", n);
}
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-ec08-c003-bc7499099f01.html
点击查看答案
10.以下哪一条不属于程序设计的3种基本结构?( )
A. 顺序结构
B. 分支结构
C. 逆转结构
D. 循环结构
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-05d8-c003-bc7499099f01.html
点击查看答案
5.已有定义“int a[][4]={1, 2, 3, 4, 5, 6, 7, 8, 9};”,则数组a第一维的大小是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-97e8-c003-bc7499099f01.html
点击查看答案
48.表达式 sizeof( )的值是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-b1b8-c003-bc7499099f00.html
点击查看答案
25.若有定义“int k,a,b;unsigned long w=8;double x=2.9;”,则下面不符合C语言语法的表达式是________。
A. x%(-3)
B. w*=-2
C. k=(a=6,b=4,a-b)
D. a*=a+=a-=(b=4)*(a=3)
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-7720-c003-bc7499099f00.html
点击查看答案
2.下面程序运行时输出的结果是()。
#include
int main()
{ int i=1, n=0;
switch( )
{case 1:
case 2: n++;
case 3: n++;
}
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-4410-c003-bc7499099f01.html
点击查看答案
2.下面程序运行时输出的结果中第3行为()。
#include
int main()
{ int i, j, k, t, b[3][3]={{9, 8, 7}, {6, 5, 4}, {3, 2, 1}};
for(j=0; j<3; j++)
for(k=0; k<2; k++)
for(i=0; i<2; i++)
if(b[i][j]>b[i+1][j])
t=b[i][j], b[i][j]=b[i+1][j], b[i+1][j]=t;
for(i=0; i<3; i++)
{ for(j=0;j<3; j++)
printf("%3d", b[i][j]);
printf( ); }
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f3-18d0-c003-bc7499099f00.html
点击查看答案
4.下面表示数学式“x<y<z”的逻辑表达式中,错误的是( )。
A. x<y<z
B. x<y&&y<z
C. !(x>=y)&&!(y>=z)
D. !(x>=y||y>=z)
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-ee20-c003-bc7499099f00.html
点击查看答案
3.只能在循环体中出现的语句是( )语句。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-8290-c003-bc7499099f02.html
点击查看答案
17.已有定义“int n=8;”,则下列表达式中,值为2的是( )。
A. n+=n-=n
B. n%=n-2
C. n>8?n=0:n++
D. n/=n+n
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-1d00-c003-bc7499099f00.html
点击查看答案