谭浩强书上列题11.11,运行不了好像有错,请大家帮我读懂一下!谢谢!
main(){ enum body
{ a,b,c,d } month[31],j; //
![](images/smilies/emot/em03.gif)
int i;
j=a; //这个是将body的a赋给j
for(i=1;i<=30;i++){
month[i]=j;
j++; //
![](images/smilies/emot/em03.gif)
if (j>d) j=a; //
![](images/smilies/emot/em03.gif)
}
for(i=1;i<=30;i++){
switch(month[i])
{
case a:printf(" %2d %c\t",i,'a'); break;
case b:printf(" %2d %c\t",i,'b'); break;
case c:printf(" %2d %c\t",i,'c'); break;
case d:printf(" %2d %c\t",i,'d'); break;
default:break;
}
}
printf("\n");