计算机二级C语言程序设计
VIP题库
有以下程序#include main(){ int x=1,y=0,a=0,b=0;switch(x){case 1:switch(y){ case 0: a++;break;case 1: b++;break;}case 2: a++;b++;break;case 3: a++;b++;}printf("a=%d,b=%d\n",a,b);}程序的运行结果是______。
若执行下面程序时从键盘上输入5,main(){int x;scanf("%d",&x);if(x++>5) printf("%d\n",x);else printf("%d\n",x--);}则输出是______。
有以下程序#include main(){ int a=1, b=0;if(!a) b++;else if(a==0) if(a) b+=2;else b+=3;printf("%d\n", b);}程序运行后的输出结果是______。
以下4个选项,不能看作一条语句的是______。
设有定义:int a=1,b=2,c=3;,以下语句中执行效果与其它三个不同的是______。
有以下程序段scanf("%d%d%d",&a,&b,&c);if(a>b) a=b;if(a>c) a=c;printf("%d\n",a);该程序段的功能是______。
以下程序段中与语句k=a>b?(b>c?1:0):0;功能等价的是______。
有以下程序#include main(){ int x,y=0,z=0,t;do{ scanf("%d",&x);t=x>0;switch (t){ case 0:break;case 1:y+=x; continue;}z+=x;}while(x);printf("%d,%d\n",y,z);}程序运行时输入:-1 1 -2 2 0,则输出结果是______。
有以下程序#include main(){ int s=0,n;for(n=0;n
有以下程序#include int m1(int x,int y){ return x
«
1
2
...
104
105
106
107
108
109
110
...
149
150
»