我头文件也有用! <stdio.h> getch(); 为什么做不到效果!高手进~
int main(){
int grade;
int acount=0;
int bcount=0;
int ccount=0;
int dcount=0;
int ecount=0;
printf ("qingshuru a-e dezimu\n");
printf ("heihei:\n");
while((grade=getchar()) !=EOF){
switch (grade){
case 'A':
case 'a':
++acount;
break;
case 'B':
case 'b':
++bcount;
break;
case 'C':
case 'c':
++ccount;
break;
case 'D':
case 'd':
++dcount;
break;
case 'E':
case 'e':
++ecount;
break;
case '\n':
case '\t':
case ' ':
break;
default :
printf ("shurugeshicuowu.");
printf ("qingchongxinshuruyigezifu:\n");
break ;
}
}
printf ("\n jieguo: \n");
printf ("A: %d\n",acount);
printf ("B: %d\n",bcount);
printf ("C: %d\n",ccount);
printf ("D: %d\n",dcount);
printf ("E: %E\n",ecount);
getch();
}