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");
}
} }
}

最新文章

  1. requests的content与text导致lxml的解析问题
  2. 树(三)&mdash;&mdash;自平衡二叉树(AVL)
  3. [转]Redmine 配置163邮箱
  4. sql over的作用及用法
  5. Oracle 逐条和批量插入数据方式对比
  6. jquery源码
  7. IIC驱动分析
  8. 五分钟看懂js关键字this
  9. 二分图的最大匹配-hdu-3729-I&#39;m Telling the Truth
  10. GF(2^8)生成元
  11. select语句后面加上for update的作用
  12. 【淡墨Unity3D Shader计划】五 圣诞用品: Unity在Shader三种形式的控制&amp;amp;混合操作编译
  13. Oak Seeds 网站项目回顾
  14. 基于Python的数据分析(2):字符串编码
  15. jsp篇 之 jsp页面中的路径问题
  16. jQuery:自定义函数
  17. Atitit.web的自动化操作与信息抓取&#160;attilax总结
  18. keras callback中的stop_training
  19. Android开发:SharedPreferences 存储数据、获取数据
  20. Git -- 基本操作 之 版本回退

热门文章

  1. fresco的使用教程
  2. eclipse安装反编译插件jadclipse
  3. Java并发(11)- 有关线程池的10个问题
  4. phpcms v9 后台添加修改页面空白页问题解决方法
  5. Codeforces 940F Machine Learning 带修改莫队
  6. [Leetcode Week8]Triangle
  7. UVALIVE 3486 Cells
  8. linux内核同步之信号量、顺序锁、RCU、完成量、关闭中断【转】
  9. 虚拟机vmware10.0.0里设置Suse Linux Enterprise 11系统静态IP上网
  10. myeclipse打断点进入后无法查看变量的值的解决方法