-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgolf.java
40 lines (27 loc) · 935 Bytes
/
golf.java
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
package acsl;
import java.util.Scanner;
public class golf {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
for (int i = 0; i < 4; i++) {
int gameScore = scanner.nextInt(); // 게임 스코어
int myScore = scanner.nextInt(); // 자신의 스코어
int calc = gameScore - myScore; // 게임 스코어 - 자신의 스코어
if (calc == 0) {
System.out.println("par");
}
else if (calc == 1) {
System.out.println("birdie");
}
else if (calc == 2) {
System.out.println("eagle");
}
else if (calc == -1) {
System.out.println("bogey");
}
else if (calc == -2) {
System.out.println("double bogey");
}
}
}
}