公众号【C you again】回复 “浙大版C语言” 查看每道题目详细实现思路
公众号【C you again】回复 “编程交流群” 进C/C++/Java编程题交流、问题解答群
本题要求编写程序将一个百分制成绩转换为五分制成绩。转换规则:
- 大于等于90分为A;
- 小于90且大于等于80为B;
- 小于80且大于等于70为C;
- 小于70且大于等于60为D;
- 小于60为E。
输入格式:
输入在一行中给出一个整数的百分制成绩。
输出格式:
在一行中输出对应的五分制成绩。
输入样例:
90
输出样例:
A
代码:
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
if(n>=90) printf("A
");
else
{
if(n>=80) printf("B
");
else
{
if(n>=70) printf("C
");
else
{
if(n>=60) printf("D
");
else printf("E
");
}
}
}
}
作者: C you again,从事软件开发 努力在IT搬砖路上的技术小白
公众号:【
C you again】分享计算机类毕业设计源码、IT技术文章、游戏源码、网页模板、程序人生等等。公众号回复 【
粉丝】进博主技术群,与大佬交流,领取干货学习资料
关于转载:欢迎大家转载本文,转载时表明出处
求赞环节:创作不易,记得
点赞+
评论+
转发
,谢谢你一路支持