4361 - 성적 주기

Time Limit: 1s Memory Limit: 128MB

Submissions: 728 Solved: 521
Description

학생들의 점수를 입력받아서 최고점을 찾아내고, 이를 토대로 학생들의 성적을 결정해주는 프로그램을 작성하세요. 규칙은 다음과 같습니다.

  • 성적이 최고점-10 이상이면 A
  • 성적이 최고점-20 이상이면 B
  • 성적이 최고점-30 이상이면 C
  • 성적이 최고점-40 이상이면 D
  • 그외는 F

Write a program that reads student scores, gets the best score, and then assigns grades based on the following scheme: 

  • Grade is A if score is ≥ best - 10
  • Grade is B if score is ≥ best - 20 
  • Grade is C if score is ≥ best - 30
  • Grade is D if score is ≥ best - 40 
  • Grade is F otherwise. 

The program prompts the user to enter the total number of students, then prompts the user to enter all of the scores, and concludes by displaying the grades.

Input

* Line 1 : 학생의 수 N (1~100)

* Line 2 ~ N+1 : 실수형태의 학생의 성적 (0~100)

 

Output

* Line 1 ~ T : 학생의 성적

Sample Input
4
40
55
70
58
Sample Output
C
B
A
B
Source

JAVA2015 PE7.1