DEV c++ 无法编译
来源:百度知道 编辑:UC知道 时间:2024/07/06 16:28:41
代码如下
# include <stdio.h>
int main (void)
{
int grade,acount=0,bcount=0,ccount=0,dcount=0,fcount=0;
printf("Enter the letter grade.\n");
printf("Enter the EOF character to end input.\n");
while ((grade = getchar())!= EOF ) {
switch (grade){
case 'a':
++acount;
break;
case 'b':
++bcount;
break;
case 'c':
++ccount;
break;
case 'd':
++dcount;
break;
case 'f':
++fcount;
break;
case '\n
# include <stdio.h>
int main (void)
{
int grade,acount=0,bcount=0,ccount=0,dcount=0,fcount=0;
printf("Enter the letter grade.\n");
printf("Enter the EOF character to end input.\n");
while ((grade = getchar())!= EOF ) {
switch (grade){
case 'a':
++acount;
break;
case 'b':
++bcount;
break;
case 'c':
++ccount;
break;
case 'd':
++dcount;
break;
case 'f':
++fcount;
break;
case '\n
我调试了一下
编译不通过原因出现在
case '':
不可以这么写
既然输入了这么可能为空呢?
根据程序感觉是
case ' ': ?
而且#和include中间不能有空格