-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path13420.java
More file actions
47 lines (44 loc) · 910 Bytes
/
13420.java
File metadata and controls
47 lines (44 loc) · 910 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// 13420. 사칙연산
// 2019.09.01
// 문자열 처리
import java.io.*;
public class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
while (t-- > 0) {
String s[] = br.readLine().split(" ");
long a = Long.parseLong(s[0]);
long b = Long.parseLong(s[2]);
long c = Long.parseLong(s[4]);
Boolean flag = false;
switch (s[1]) {
case "+":
if (a + b == c) {
flag = true;
}
break;
case "-":
if (a - b == c) {
flag = true;
}
break;
case "*":
if (a * b == c) {
flag = true;
}
break;
case "/":
if (a / b == c) {
flag = true;
}
break;
}
if (flag) {
System.out.println("correct");
} else {
System.out.println("wrong answer");
}
}
}
}