题目:编写程序,输入任意一个 1~7 之间的整数,将他们转换成对应的英文单词。
例如:1转换成 Monday, 7 转换成 Sunday。
#include <stdio.h>
int main()
{
int day;
scanf("%d", &day);
switch (day)
{
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("Firday\n");
break;
case 6:
printf("Saturday\n");
break;
case 7:
printf("Sunday\n");
break;
default:
printf("data error!");
break;
}
return 0;
}