首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

书下例子有有关问题

2012-09-20 
书上例子有问题,求助#includestdio.henum{Jan1,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}mothfl

书上例子有问题,求助
#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 时出错.


[解决办法]

探讨

删掉第二行的等号

[解决办法]
探讨

删掉错更多啊

热点排行