当前位置:网站首页>OJ daily practice - grade score
OJ daily practice - grade score
2022-04-21 16:09:00 【Kj JK】
Problem description :
Give a 100 point mark , Output grade is required ‘A’、‘B’、‘C’、‘D’、‘E’.
90 Points and above are A
80-89 It is divided into B
70-79 It is divided into C
60-69 It is divided into D
60 It is divided into the following E
Input
An integer 0-100 within , Represents the achievement of the hundred mark system
Output
A character , Indicates the grade
Examples
Input
90
Output
A
Java Code :
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner rd=new Scanner(System.in);
int a=rd.nextInt();
String b=check(a);
// System.out.println(b);
}
public static String check(int a){
if(a>=90){
System.out.println("A");
}else if(a>=80&&a<=89){
System.out.println("B");
}else if(a>=70&&a<=79){
System.out.println("C");
}else if(a>=60&&a<=69){
System.out.println("D");
}else{
System.out.println("E");
}
return null;
}
}
C Code :
#include <stdio.h>
int main(){
int score;
scanf("%d",&score);
if(score>=90){
printf("A");
}else if(score>=80&&score<=89){
printf("B");
}else if(score>=70&&score<=79){
printf("C");
}else if(score>=60&&score<=69){
printf("D");
}else{
printf("E");
}
}
python Code :
score=int(input())
if score>=90 :
print("A")
elif score>=80 and score<=89:
print("B")
elif score>=70 and score<=79:
print("C")
elif score>=60 and score<=69:
print("D")
elif score<60:
print("E")
author :KJ.JK
This article is only for communication learning , Without the permission of the author , Prohibited reproduced , Let alone for other purposes , Offenders will investigate .
If the article is helpful to you , Welcome to praise or star, Your support is the greatest encouragement to the author , The shortcomings can be corrected in the comments section , Communication and learning
版权声明
本文为[Kj JK]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211608484839.html
边栏推荐
- The conflict between Russia and Ukraine raised concerns. The five eye network security department suggested that allies strengthen infrastructure protection measures
- 汇编语言程序设计:模块化程序设计 输入字符类型统计的设计与调试
- 期约与异步函数
- PowerShell blog directory
- 目前主流的手机屏幕类型都有哪些
- php大文件上传和断点续传
- Ji Geng 42 / 90
- [2023 school recruitment questions] Huawei's character evaluation (Comprehensive Evaluation) Strategic Guide
- 云呐:大型医疗设备资产管理系统贵吗?医院资产管理的主要内容
- 金仓数据库KingbaseES V8R3集群在线删除数据节点案例
猜你喜欢

Lightly: a new generation of PHP IDE

Avril 2022 classement de la base de données de la Chine: la brise printanière se réchauffe et les scores rebondissent en avril

关于nodejs fs readFileSync 过程中强行关机 拉闸 断电 导致文件损坏的问题解决方案

Sharkteam releases quarterly report on security situational awareness of Q1 smart contract in 2022

云呐:大型医疗设备资产管理系统贵吗?医院资产管理的主要内容

必刷|2022年重庆最新八大员之(安全员)模拟题库及答案

New media people must have 10 efficiency tools and artifact collection

俄乌冲突引发顾虑 五眼网络安全部门建议盟友增强基础设施防护措施

Qt5. 14.2 compiling MySQL

Servlet
随机推荐
Mark, 365 fans in two years
The conflict between Russia and Ukraine raised concerns. The five eye network security department suggested that allies strengthen infrastructure protection measures
SAP Fiori smart template技术里CDS view的注解和UI元素对应关系
必刷|2022年重庆最新八大员之(安全员)模拟题库及答案
R语言coin包应用于独立性问题的置换检验(permutation tests)、使用wilcox.test函数进行两组数据的Wilcoxon符号秩检验、使用wilcoxsign_test函数置换检验
Root unlock problem
2022年重庆最新建筑施工焊工(建筑特种作业)模拟题库及答案
Buuctf's [actf2020 freshman competition] BackupFile
云呐:大型医疗设备资产管理系统贵吗?医院资产管理的主要内容
How can transformer break into the CV world and kill CNN?
关于nodejs fs readFileSync 过程中强行关机 拉闸 断电 导致文件损坏的问题解决方案
root 解锁问题
【2023校招刷题】华为性格测评(综合测评)战略指南
Detailed explanation of swap automatic arbitrage robot ecosystem development mode
云呐:机房资产管理系统web版,设备资产信息管理的应用
2022 年 4 月中國數據庫排行榜:春風拂面春意暖,分數回昇四月天
Assembly language programming: design and debugging of input character type statistics in modular programming
十荟团 小程序 APP自动登录 aes数据解密 学习记录
New media people must have 10 efficiency tools and artifact collection
Xiaomi Hongmi's note 4x brush machine succeeded