编程题:为枚举类型变量赋值。将整型值强制类型转换成枚举类型赋值
#include<stdio.h>
void main()
{ enum season {spring,summer,autumn,winter}s1,s2;
s1=summer;
s2=(enum season)2;
printf("s1=%d,s2=%d\n",s1,s2);
}
编程题:为枚举类型变量赋值。将整型值强制类型转换成枚举类型赋值,布布扣,bubuko.com
时间: 2024-12-18 10:21:37