早教吧作业答案频道 -->其他-->
4.10输出星期几的英文表示switch语句}#includevoidmain(){intn;scanf("%d",&n);switch(n){case1:printf("Monday\n");break;case2:printf("Tuesday\n");break;case3:printf("Wednesday\n");break;case4:printf("Thursday\n");break;case5:pr
题目详情
4.10 输出星期几的英文表示switch语句}#include void main() { int n; scanf("%d",&n); switch(n) { case1:printf("Monday\n");break; case2:printf("Tuesday\n");break; case3:printf("Wednesday\n");break; case4:printf("Thursday\n");break; case5:printf("Friday\n");break; case6:printf("Saturday\n");break; case7:printf("Sunday\n");break; default:printf("Error\n"); } }为什么我输入什么都显示Error 请大神赐教
▼优质解答
答案和解析
#include #include int main() { int n; scanf("%d",&n); switch(n) { case 1:printf("Monday\n");break; case 2:printf("Tuesday\n");break; case 3: printf("Wednesday\n");break; case 4:printf("Thursday\n");break; case 5:printf("Friday\n");break; case 6:printf("Saturday\n");break; case 7:printf("Sunday\n");break; default:printf("Error\n"); break; } system("pause"); return 0; } ----------------------------case 后面要加空格 例如: case 1:printf("Monday\n");break;
看了 4.10输出星期几的英文表示...的网友还看了以下:
#include"stdio.h"main();{inta,m;scanf("%d",&a);swi 2020-03-31 …
give away,put away,take away,come away,give back, 2020-05-16 …
C语言问题关于素数voidnum(intm,intk,intxx[]){intdata=m+1;i 2020-05-17 …
在线等p=p->last;fnum=0("套接字的绑定失败!\n");case2:indelete 2020-06-05 …
s=3;switch(s){case2:s=7;break;case3;s=99;s++;case 2020-06-06 …
题2.8.求解下面的switch(c-'5')是什么意思...#include"stdio.h"m 2020-06-11 …
1.以下程序的输出结果是什么.#includevoidmain(){inta=1,b=0;swit 2020-07-23 …
#includeintmain(){inta,s=0;cin>>a;switch(a-3){cas 2020-07-23 …
4.10输出星期几的英文表示switch语句}#includevoidmain(){intn;sc 2020-08-03 …
关于枚举类型的题:已知enumname{zhao=1,qian,sun,li}man;执行下述程序段 2020-11-27 …