枚举和结构体类似:
#include <stdio.h>
enum DAY
{
MON=1,TUE=2,WED=3,THU=4,FRI=5,SAT=6,SUN=7//枚举
}day;
int main()
{
for (day = MON; day <= SUN; day++)
{
printf("%d",day);
}
return 0;
}
枚举和结构体类似:
#include <stdio.h>
enum DAY
{
MON=1,TUE=2,WED=3,THU=4,FRI=5,SAT=6,SUN=7//枚举
}day;
int main()
{
for (day = MON; day <= SUN; day++)
{
printf("%d",day);
}
return 0;
}