主题:帮忙看看,巨郁闷的出错提示
#include <stdio.h>
void main(void)
{
char g;
printf("input grade\n");
scanf("%c",&g);
switch(g)
{
cese 'a': printf("85-100"); break;
cese 'b': printf("74-85"); break;
cese 'c': printf("60-69"); break;
cese 'd': printf("<60"); break;
defaut: printf("error date!");
}
}
编译如下
E:\MSDev98\Bin\year.cpp(9) : error C2065: 'cese' : undeclared identifier
E:\MSDev98\Bin\year.cpp(9) : error C2143: syntax error : missing ';' before 'constant'
E:\MSDev98\Bin\year.cpp(9) : error C2143: syntax error : missing ';' before ':'
E:\MSDev98\Bin\year.cpp(10) : error C2143: syntax error : missing ';' before 'constant'
E:\MSDev98\Bin\year.cpp(10) : error C2143: syntax error : missing ';' before ':'
E:\MSDev98\Bin\year.cpp(11) : error C2143: syntax error : missing ';' before 'constant'
E:\MSDev98\Bin\year.cpp(11) : error C2143: syntax error : missing ';' before ':'
E:\MSDev98\Bin\year.cpp(12) : error C2143: syntax error : missing ';' before 'constant'
E:\MSDev98\Bin\year.cpp(12) : error C2143: syntax error : missing ';' before ':'
E:\MSDev98\Bin\year.cpp(14) : warning C4060: switch statement contains no 'case' or 'default' labels
执行 cl.exe 时出错.
year.exe - 1 error(s), 0 warning(s)
void main(void)
{
char g;
printf("input grade\n");
scanf("%c",&g);
switch(g)
{
cese 'a': printf("85-100"); break;
cese 'b': printf("74-85"); break;
cese 'c': printf("60-69"); break;
cese 'd': printf("<60"); break;
defaut: printf("error date!");
}
}
编译如下
E:\MSDev98\Bin\year.cpp(9) : error C2065: 'cese' : undeclared identifier
E:\MSDev98\Bin\year.cpp(9) : error C2143: syntax error : missing ';' before 'constant'
E:\MSDev98\Bin\year.cpp(9) : error C2143: syntax error : missing ';' before ':'
E:\MSDev98\Bin\year.cpp(10) : error C2143: syntax error : missing ';' before 'constant'
E:\MSDev98\Bin\year.cpp(10) : error C2143: syntax error : missing ';' before ':'
E:\MSDev98\Bin\year.cpp(11) : error C2143: syntax error : missing ';' before 'constant'
E:\MSDev98\Bin\year.cpp(11) : error C2143: syntax error : missing ';' before ':'
E:\MSDev98\Bin\year.cpp(12) : error C2143: syntax error : missing ';' before 'constant'
E:\MSDev98\Bin\year.cpp(12) : error C2143: syntax error : missing ';' before ':'
E:\MSDev98\Bin\year.cpp(14) : warning C4060: switch statement contains no 'case' or 'default' labels
执行 cl.exe 时出错.
year.exe - 1 error(s), 0 warning(s)