按成绩输出等级

该程序旨在接收用户输入的一百分制成绩,并根据特定等级划分标准输出对应的等级,如90分及以上为A,80-89分为B,70-79分为C,60-69分为D,60分以下为E。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

任务描述

本关任务:编写程序,输入一百分制成绩,输出等级。

编程要求

根据提示,在右侧编辑器补充代码,给出一百分制成绩,要求输出等级 A,B,C,D,E。90 分以上为 A;80-89 分为 B;70-79 分为 C;60-69 分为 D;60 分以下为 E。

测试说明

平台会对你编写的代码进行测试:

测试输入:95预期输出:

The grade is A

#include <stdio.h>
void main()
{
  int score;
  printf("Please input student score:");
  scanf("%d",&score);
  /*********** Begin **********/
    if(score>=90)
      printf("The grade is A");
    if (score<90 && score>=80)
      printf("The grade is B");
    if (score<80 && score>=70)
      printf("The grade is C");
    if (score<70 && score>=60)
      printf("The grade is D");
    if (score<60)
      printf("The grade is E");
    return 0;



  /*********** End **********/
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值