解题思路:
注意事项:
星期六虽然是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; }