[백준] 2754번 문제, 학점계산
문제
여기를 눌러 문제를 확인하세요.
코드
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
String grade = sc.next();
switch(grade) {
case "A+":
System.out.println("4.3");
break;
case "A0":
System.out.println("4.0");
break;
case "A-":
System.out.println("3.7");
break;
case "B+":
System.out.println("3.3");
break;
case "B0":
System.out.println("3.0");
break;
case "B-":
System.out.println("2.7");
break;
case "C+":
System.out.println("2.3");
break;
case "C0":
System.out.println("2.0");
break;
case "C-":
System.out.println("1.7");
break;
case "D+":
System.out.println("1.3");
break;
case "D0":
System.out.println("1.0");
break;
case "D-":
System.out.println("0.7");
break;
case "F":
System.out.println("0.0");
}
sc.close();
}
}