- #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 MONDAY:
- printf("TODAY IS MONDAY!\n");
- break;
- case TUESDAY:
- printf("TODAY IS TUESDAY!\n");
- break;
- case WEDNESDAY:
- printf("TODAY IS WEDNESDAY!\n");
- break;
- case THURSDAY:
- printf("TODAY IS THURSDAY!\n");
- break;
- case FRIDAY:
- printf("TODAY IS FRIDAY!\n");
- break;
- case SATURDAY:
- printf("TODAY IS SATURDAY!\n");
- break;
- case SUNDAY:
- printf("TODAY IS SUNDAY!\n");
- break;
- default :
- printf("SYSTEM CAN NOT DISTINGUISH!\n");
- }
- return 0;
- }
复制代码
|
|