enum season{
spring = 1,
summer,
autumn,
winter //没有,
};//;
//变量类型是 enum season 变量名是 currentSeason 变量初始值为spring
printf("输入一个整型数字(1~4):");
scanf("%d",¤tSeason);
switch (currentSeason) {
case spring:
printf("放风筝");
break;
case summer:
printf("游泳");
break;
case autumn:
printf("看枫叶");
break;
case winter:
printf("滑雪");
break;
default:
break;
}
return 0;
}
时间: 2024-11-10 04:48:36