- #include <stdio.h>
- int main()
- {
- enum week
- {
- MONDAY = 1,
- TUESDAY,
- WEDNESDAY,
- THURSDAY,
- FRIDAY,
- SATURDAY,
- SUNDAY,
- };
- int h;
- printf("请输入1-7任意一个整数!\n");
- scanf("%d",&h);
- enum week day=h;
- switch(day)
- {
- case 1:
- printf("TODAY IS MONDAY!\n");
- break;
- case 2:
- printf("TODAY IS TUESDAY!\n");
- break;
- case 3:
- printf("TODAY IS WEDNESDAY!\n");
- break;
- case 4:
- printf("TODAY IS THURSDAY!\n");
- break;
- case 5:
- printf("TODAY IS FRIDAY!\n");
- break;
- case 6:
- printf("TODAY IS SATURDAY!\n");
- break;
- case 7:
- printf("TODAY IS SUNDAY!\n");
- break;
- default :
- printf("SYSTEM CAN NOT DISTINGUISH!\n");
- }
- return 0;
- }
复制代码
|
|