package com.sss.shang.testday1;
import java.util.Scanner;
public class ArrayTest {
?public static void main(String[] args) {
??? ?// TODO Auto-generated method stub
??? ?Scanner scanner = new Scanner(System.in);
??? ?System.out.println("input num");
??? ?int num = scanner.nextInt();
??? ?int[] score = new int[num];
??? ?
??? ?//輸入成績(jī)
??? ?for (int i = 0; i< num; i++) {
??? ??? ?System.out.println("input "+(i+1)+"score");
??? ??? ?score[i] = scanner.nextInt();
??? ?}
??? ?
??? ?//找出大成績(jī)
??? ?int numFlag = 0;
??? ?for (int i = 0; i< num; i++) {
??? ??? ?if (numFlag< score[i]) {
??? ??? ??? ?numFlag = score[i];
??? ??? ?}
??? ?}
??? ?
??? ?//等級(jí)
??? ?for (int i = 0; i< num; i++) {
??? ??? ?if (score[i] >= numFlag-10) {
??? ??? ??? ?System.out.println((i+1)+"位等級(jí)"+"A");
??? ??? ?}else if (score[i] >= numFlag-20) {
??? ??? ??? ?System.out.println((i+1)+"位等級(jí)"+"B");
??? ??? ?}else if (score[i] >= numFlag-30) {
??? ??? ??? ?System.out.println((i+1)+"位等級(jí)"+"C");
??? ??? ?}else {
??? ??? ??? ?System.out.println((i+1)+"位等級(jí)"+"D");
??? ??? ?}
??? ?}
??? ?
??? ?
?}
}
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購(gòu),新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧