|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include<stdio.h>
main()
{
int score;
printf("input a score:");
scanf("%d\n",&score);
if (score<60)
{
printf("The score is E");
}
else if (score>=60&&score<70)
{
printf("The score is D");
}
else if (score>=70&&score<80)
{
printf("The score is C");
}
else if (score>=80&&score<90)
{
printf("The score is B");
}
else
{
printf("The score is A");
}
}
scanf里面别要\n了,它没有什么用
- #include<stdio.h>
- main()
- {
- int score;
- printf("input a score:");
- scanf("%d",&score);
- if (score<60)
- {
- printf("The score is E");
- }
- else if (score>=60&&score<70)
- {
- printf("The score is D");
- }
- else if (score>=70&&score<80)
- {
- printf("The score is C");
- }
- else if (score>=80&&score<90)
- {
- printf("The score is B");
- }
- else
- {
- printf("The score is A");
- }
-
- }
复制代码
|
|