File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments