forked from sowon-dev/AlgorithmStudy_Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc1068.java
More file actions
47 lines (43 loc) · 1.16 KB
/
c1068.java
File metadata and controls
47 lines (43 loc) · 1.16 KB
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
package codeup100;
import java.util.Scanner;
public class c1068 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int score = sc.nextInt();
sc.close();
// 풀이방법 2가지
// 첫번째 : if문
if(score >=90 && score <=100){
System.out.println("A");
}else if(score >=70 && score < 90){
System.out.println("B");
}else if(score >=40 && score < 70){
System.out.println("C");
}else{
System.out.println("D");
}
// 두번째 : switch문
switch (score/10) {
case 10 :
case 9 :
System.out.println("A");
break;
case 8 :
case 7 :
System.out.println("B");
break;
case 6 :
case 5 :
case 4 :
System.out.println("C");
break;
case 3 :
case 2 :
case 1 :
System.out.println("D");
break;
default :
System.out.println("D");
}
}
}