指定等级 Exercise07_01
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");
}
} }
}
指定等级 Exercise07_01的更多相关文章
- Log4net - 规则简介
参考页面: http://www.yuanjiaocheng.net/CSharp/csharprumenshili.html http://www.yuanjiaocheng.net/entity/ ...
- log4net使用手册
1. log4net简介 log4net是.Net下一个非常优秀的开源日志记录组件.log4net记录日志的功能非常强大.它可以将日志分不同的等级,以不同的格式,输出到不同的媒介.Java平台下,它还 ...
- Swift3.0P1 语法指南——方法
原档:https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programmi ...
- 2015-08-26: GCC编译选项(转载)
gcc提供了大量的警告选项,对代码中可能存在的问题提出警告,通常可以使用-Wall来开启以下警告: -Waddress -Warray-bounds (only with -O2) ...
- (转)非常完善的Log4net详细说明
转自:http://www.cnblogs.com/zhangchenliang/p/4546352.htmlhttp://www.cnblogs.com/zhangchenliang/p/45463 ...
- PHP的PSR系列规范都有啥内容
PSR 是PHP Standard Recommendation的简写,它其实应该叫PSRs,即系列推荐标准:目前通过的规范有PSR-0(Autoloading Standard).PSR-1(Bas ...
- log4net在Asp.net Mvc中的应用配置与介绍
log4net在.NET中的地位就不多言语了,此篇文章着重配置.较少介绍使用.因为在网上你可以在网上搜到几十万的文章告诉你怎么用.安装的话也不废话了,很简单.Nuget里搜索一下"log4n ...
- log4net详解(转载)
1.概述 log4net是.Net下一个非常优秀的开源日志记录组件.log4net记录日志的功能非常强大.它可以将日志分不同的等级,以不同的格式,输出到不同的媒介.本文主要是介绍如何在Visual S ...
- 攻城狮在路上(叁)Linux(二十九)--- 完整备份工具:dump以及restore
一.dump命令: 该命令既可以针对整个文件系统进行备份,也可以仅针对目录来备份.还可以指定不同的备份等级(-0~-9共10个等级). dump -W:列出在/etc/fstab中具有dump设置的分 ...
随机推荐
- bzoj 1110 [POI2007]砝码Odw 贪心+进制转化
[POI2007]砝码Odw Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 661 Solved: 366[Submit][Status][Disc ...
- gitlab7.2安装
系统:centos6.4 1.安装依赖包 导入epel: useradd git wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-rel ...
- Spring学习--切面优先级及重用切点表达式
指定切面的优先级: 在同一个链接点上应用不止一个切面时 , 除非明确指定 , 否则它们的优先级是不确定的. 切面的优先级可以通过实现 Ordered 接口或利用 @Order 注解指定. 实现 Ord ...
- 自建git服务器搭建使用记录
git在push的时候出现insufficient permission for adding an object错误 //解决方法,在git库的目录下 //明明一开始创建user的时候有执行这个命令 ...
- 记录一次Nginx跳转报错的问题
错误信息如下: An error occurred. Sorry, the page you are looking for is currently unavailable. Please try ...
- php连接mysql报错——Fatal error: Call to undefined function mysql_connect() in
练习php连接mysql数据库 代码:mysql_connect("127.0.0.1:3306","root", ..... 浏览器报错:Fatal erro ...
- bzoj2453/2120 数颜色
传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2120 http://www.lydsy.com/JudgeOnline/problem.ph ...
- HIT 1917 2—SAT
题目大意:一国有n个党派,每个党派在议会中都有2个代表, 现要组建和平委员会,要从每个党派在议会的代表中选出1人,一共n人组成和平委员会. 已知有一些代表之间存在仇恨,也就是说他们不能同时被选为和平委 ...
- BZOJ1037 DP
2013-11-15 21:51 原题传送门http://www.lydsy.com/JudgeOnline/problem.php?id=1037 拿到这道题想到了DP,后来发现三维无法确定的表示状 ...
- dj定时任务
参考:http://www.mknight.cn/post/13/ https://blog.csdn.net/sicofield/article/details/50937338 一.INSTALL ...