指定等级 Exercise07_01
2024-09-02 05:16:30
import java.util.Scanner;
/**
* @author 冰樱梦
* 时间:2018年下半年
* 题目:指定等级
*
*/
public class Exercise07_01 {
public static void main(String[] args){
int score[]=new int[100];
Scanner input = new Scanner(System.in);
System.out.println("Enter the number of students: ");
int students=input.nextInt();
System.out.println("Enter " + students +" scores: ");
int best=0;
for(int i=0;i<students;i++){
score[i]=input.nextInt();
if(score[i]>best){
best=score[i];
}
}
for(int i=0;i<students;i++){
if(score[i]>=best-10){
System.out.println("Student " + i +" scores is " + score[i] + " and grade is A");
}
else if(score[i]>=best-20){
System.out.println("Student " + i +" scores is " + score[i] + " and grade is B");
}
else if(score[i]>=best-30){
System.out.println("Student " + i +" scores is " + score[i] + " and grade is C");
}
else if(score[i]>=best-40){
System.out.println("Student " + i +" scores is " + score[i] + " and grade is D");
}
else{
System.out.println("Student " + i +" scores is " + score[i] + " and grade is F");
}
} }
}
最新文章
- requests的content与text导致lxml的解析问题
- 树(三)&mdash;&mdash;自平衡二叉树(AVL)
- [转]Redmine 配置163邮箱
- sql over的作用及用法
- Oracle 逐条和批量插入数据方式对比
- jquery源码
- IIC驱动分析
- 五分钟看懂js关键字this
- 二分图的最大匹配-hdu-3729-I&#39;m Telling the Truth
- GF(2^8)生成元
- select语句后面加上for update的作用
- 【淡墨Unity3D Shader计划】五 圣诞用品: Unity在Shader三种形式的控制&;amp;混合操作编译
- Oak Seeds 网站项目回顾
- 基于Python的数据分析(2):字符串编码
- jsp篇 之 jsp页面中的路径问题
- jQuery:自定义函数
- Atitit.web的自动化操作与信息抓取&#160;attilax总结
- keras callback中的stop_training
- Android开发:SharedPreferences 存储数据、获取数据
- Git -- 基本操作 之 版本回退
热门文章
- fresco的使用教程
- eclipse安装反编译插件jadclipse
- Java并发(11)- 有关线程池的10个问题
- phpcms v9 后台添加修改页面空白页问题解决方法
- Codeforces 940F Machine Learning 带修改莫队
- [Leetcode Week8]Triangle
- UVALIVE 3486 Cells
- linux内核同步之信号量、顺序锁、RCU、完成量、关闭中断【转】
- 虚拟机vmware10.0.0里设置Suse Linux Enterprise 11系统静态IP上网
- myeclipse打断点进入后无法查看变量的值的解决方法