关于if的用法
int score;scanf(" %d",&score);
if( score < 60)
{
printf ("The score is E !\n");
}
else if( (score > 60|| score == 60) && score < 70);
{
printf("The score is D !\n");
}
else if((score>70 || score == 70)&&score <80);
{
printf(" The score is C!\n");
}
else if ((score > 80) ||score == 80 )&& score < 90);
{
printf("The score is B!\n");
}
else if ( 90 <= score);
{
printf("The score is A!\n");
}
大佬们能帮忙看看哪里出错了吗 scanf(" %d",&score);这句%d前边多一个空格 还有else if语句后边的分号去掉 #include <stdio.h>
int main()
{
int score;
scanf("%d",&score);
if( score < 60)
{
printf ("The score is E !\n");
}
else if( (score > 60|| score == 60) && score < 70)
{
printf("The score is D !\n");
}
else if((score>70 || score == 70)&&score <80)
{
printf(" The score is C!\n");
}
else if ((score > 80 ||score == 80 )&& score < 90)
{
printf("The score is B!\n");
}
else
{
printf("The score is A!\n");
}
}
非常感谢!
页:
[1]