书上例子有问题,求助
#include"stdio.h"
enum={Jan=1,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}moth;
float yearern,mothern;
for (yearern=0,moth=Jan;moth<=Dec;moth++)
{ printf("please enter mothly erning for");
switch(moth)
{ case Jan:printf("Jan:\n");break;
case Feb:printf("Feb:\n");break;
case Mar:printf("Mar:\n");break;
case Apr:printf("Apr:\n");break;
case May:printf("May:\n");break;
case Jun:printf("Jun:\n");break;
case Jul:printf("Jul:\n");break;
case Aug:printf("Aug:\n");break;
case Sep:printf("Sep:\n");break;
case Oct:printf("Oct:\n");break;
case Nov:printf("Nov:\n");break;
case Dec:printf("Dec:\n");break;
}
scanf("%f",&monthern);
yearern+=monthern;
}
printf("The yearern is %f\n",yearenrn);
}
--------------------Configuration: helloc - Win32 Debug--------------------
Compiling...
helloc.cpp
D:\VC语言\helloc\helloc.cpp(2) : error C2513: 'enum $S1' : no variable declared before '='
D:\VC语言\helloc\helloc.cpp(2) : fatal error C1903: unable to recover from previous error(s); stopping compilation
执行 cl.exe 时出错.
[解决办法]
[解决办法]