forked from JustinSDK/JavaSE6Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScoreLevel2.java
More file actions
29 lines (26 loc) · 781 Bytes
/
ScoreLevel2.java
File metadata and controls
29 lines (26 loc) · 781 Bytes
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
import java.util.Scanner;
public class ScoreLevel2 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("請輸入分數: ");
int score = scanner.nextInt();
int level = (int) score/10;
switch(level) {
case 10:
case 9:
System.out.println("得A");
break;
case 8:
System.out.println("得B");
break;
case 7:
System.out.println("得C");
break;
case 6:
System.out.println("得D");
break;
default:
System.out.println("得E(不及格)");
}
}
}