c语言求助
#include<stdio.h>main()
{
int score;
scanf("%d",&score);
if(socre < 60)
{
printf("The score is E!");
}
else if((score > 60 || score == 60) && score < 70)
{
printf("The score is D!");
}
else if((score > 70 || score == 70) && score < 80)
{
printf("The score is C!");
}
else if((socre > 80 || socre == 80) && socre < 90)
{
printf("The socre is B!");
}
else
{
printf("The socre is A!");
}
}
为什么我编译之后提示
E:\vc++\MSDev98\MyProjects\555555555\rr.cpp(6) : error C2065: 'socre' : undeclared identifier
E:\vc++\MSDev98\MyProjects\555555555\rr.cpp(29) : warning C4508: 'main' : function should return a value; 'void' return type assumed
Error executing cl.exe.
rr.obj - 1 error(s), 1 warning(s)
这是出了什么问题吗??
'socre' ?:sweat: 拼写错误骚年,是score不是socre 没加return 0; 哈哈哈 我真是太不小心了 谢谢楼主们 "score" 写成了 "socre" , 如果 main() 前面没有返回值类型,默认是 int, 最后应该写一句, return 0(也可以是其它的整数);
页:
[1]