Skip to content

Commit 465c1b0

Browse files
authored
BOJ #17826: 나의 학점은?
1 parent 47f42f2 commit 465c1b0

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

BOJ/17826/Main.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Author: Minho Kim (ISKU)
3+
* Date: December 5, 2019
4+
* E-mail: minho.kim093@gmail.com
5+
*
6+
* https://github.com/ISKU/Algorithm
7+
* https://www.acmicpc.net/problem/17826
8+
*/
9+
10+
import java.io.*;
11+
import java.util.*;
12+
13+
public class Main {
14+
public static void main(String[] args) throws Exception {
15+
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
16+
17+
StringTokenizer st = new StringTokenizer(br.readLine());
18+
int[] score = new int[50];
19+
for (int i = 0; i < 50; i++)
20+
score[i] = Integer.parseInt(st.nextToken());
21+
22+
int target = Integer.parseInt(br.readLine());
23+
for (int i = 49; i >= 0; i--) {
24+
if (score[i] == target) {
25+
System.out.println(getGrade(i + 1));
26+
break;
27+
}
28+
}
29+
}
30+
31+
private static String getGrade(int rank) {
32+
if (rank <= 5)
33+
return "A+";
34+
if (rank <= 15)
35+
return "A0";
36+
if (rank <= 30)
37+
return "B+";
38+
if (rank <= 35)
39+
return "B0";
40+
if (rank <= 45)
41+
return "C+";
42+
if (rank <= 48)
43+
return "C0";
44+
return "F";
45+
}
46+
}

0 commit comments

Comments
 (0)