以下程序的执行结果是( )。#include main(){ int a,b,c;a=2;b=3;c=1;if (a>b)if (a>c)printf("%d",a);elseprintf("%d",b);printf("end");}
查看答案
以下程序的执行结果是( )。#include main(){ int a,b,c,d,x;a=c=0;b=1;d=20;if(a)d=d-10;else if(!b)if (!c)x=15;else x=25;printf("d=%d\n",d);}
以下程序在输入5,2之后的执行结果是( )。#include main(){ int s,t,a,b;scanf("%d,%d",&a,&b);s=1;t=1;if(a>0) s=s+1;if(a>b) t=s+t;else if(a==b) t=5;else t=2*s;printf("s=%d,t=%d\n",s,t);}
以下程序的执行结果是( )。#include main(){ int x=1,y=0;switch(x){ case 1:switch(y){ case 0:printf("first");break;case 1:printf("second");break; }case 2:printf("third");}}
执行以下程序,输入-10的结果是( ),输入5的结果是( ),输入10的结果是( ),输入30的结果是( )。#include main(){ int x,c,m;float y;scanf("%d",&x);if (x<0) c=-1;else c= x/10;switch (c){case-1:y=0;break;case 0:y=x;break;case 1:y=10;break;case 2:case 3:y=-0.5*x+20;break;default:y=-2; }if (y!=-2) printf("y=%g\n",y);else printf("error\n");}