解题思路:
注意事项:
星期六虽然是saturday,但是老师给的例子是satday;
参考代码:
#include<stdio.h>
int main()
{
int a;
scanf("%d",&a);
switch(a)
{
case (0):
{
printf("Sunday\n");
break;
}
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("Satday\n");
break;
}
default:
printf("input error!\n");
}
return 0;
}
0.0分
3 人评分
#include<stdio.h> int main() { int a; scanf("%d",&a); switch(a) { case 0: printf("Sunday\n"); break; 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; default: printf("input error!\n"); } return 0; }
奖学金 (C++代码)浏览:2053 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:484 |
C语言程序设计教程(第三版)课后习题6.5 (C++代码)浏览:487 |
Cylinder (C语言描述,蓝桥杯)浏览:1279 |
DNA (C语言代码)浏览:440 |
Tom数 (C语言代码)浏览:581 |
C语言训练-亲密数 (C语言描述,反正怎么都能对)浏览:2256 |
钟神赛车 (C语言代码)浏览:665 |
图形输出 (C语言代码)浏览:1019 |
C语言训练-自守数问题 (C语言代码)浏览:798 |