博客
关于我
三级制成绩评级
阅读量:402 次
发布时间:2019-03-05

本文共 445 字,大约阅读时间需要 1 分钟。

学生成绩评等级规则

根据学生成绩(百分制)评等级规则,具体评定标准如下:

  • [80, 100]:评为A等级
  • [60, 79]:评为B等级
  • [0, 59]:评为C等级

输入要求

输入一个有效的整数形式的百分制成绩,其中 0 ≤ x ≤ 100。

输出要求

根据成绩范围输出对应的等级:

- 若成绩大于等于 80,输出 "A" - 若成绩在 60 到 79 之间,输出 "B" - 若成绩小于 60,输出 "C"

示例输入输出

  • 输入:60
  • 输出:B

技术实现参考代码

#include 
int main() { int score; scanf("%d", &score); if (score >= 80) { printf("A\n"); } else if (score >= 60) { printf("B\n"); } else { printf("C\n"); } return 0;}

转载地址:http://pxszz.baihongyu.com/

你可能感兴趣的文章
Pytest ------ 标记函数
查看>>
Pytest Fixture的妙用:深度解析范围和实际运用!
查看>>
Pytest monkeypatch不适用于导入的函数
查看>>
Pytest 命令行报错: Hint: make sure your test modules/packages have valid Python names.
查看>>
pytest 的 request fixture:实现个性化测试需求
查看>>
Pytest+Allure 接口自动化测试平台开发实战
查看>>
pytest+allure使用动态级别,参数化severity
查看>>
Pytest+Unittest+Git+Jenkins企业级CICD自动化测试平台建设方案
查看>>
Pytest+Yaml 数据驱动测试用例
查看>>
pytest-base-url插件之配置可选的项目系统URL
查看>>
pytest-xdist 进行多进程并发测试!
查看>>
pytest-xdist:远程多主机 - 分布式运行自动化测试
查看>>
Pytest中doctests的测试方法应用!
查看>>
Pytest中进行测试环境切换:pytest_addoption!
查看>>
pytest利用request fixture实现个性化测试需求详解
查看>>
pytest单元测试实战
查看>>
pytest单元测试框架
查看>>
Pytest参数详解 — 基于命令行模式
查看>>
pytorch cv2 plt transforms pause waitforbuttonpress一个完整的图片处理程序
查看>>
pytest学习和使用 - Pytest用例执行结果有哪几种状态?
查看>>