题目内容

写出下列程序的运行结果#include void main(){int n='c';switch(n++){default:printf("error");break;case 'a': case 'A':case 'b':case 'B':printf("good");break;case 'c':case 'C':printf("pass");case 'd':case'D':printf("warm");}}

查看答案
更多问题

#includevoid main(){int a=-1,b=1;if((++a<0)&&(b--<=0))printf("%d,%d\n",a,b);else printf("%d,%d\n",b,a);}

#includevoid 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;}printf("a=%d,b=%d\n",a,b);}

#includevoid main(){int t,h,m;scanf("%d",&t);h=(t/100)%12;if(h==0) h=12;printf("%d: ",h);m=t%100;if(m<10)printf("0");printf("%d", m);if(t<1200||t==2400)printf("AM");else printf("PM");}若运行时输入:1605,写出运行结果

给出一个百分制成绩,要求输出成绩等级‘A’、‘B’、‘C’、‘D’、‘E’。成绩大于等于90为‘A’,成绩在80~89之间为‘B’,成绩在70~79之间为‘C’,成绩在60~69之间为‘D’,成绩小于60为‘E’,编程实现此功能。

答案查题题库