-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path_4153.java
More file actions
44 lines (40 loc) ยท 1022 Bytes
/
_4153.java
File metadata and controls
44 lines (40 loc) ยท 1022 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
package backjoon;
// https://www.acmicpc.net/problem/4153
// ์ง๊ฐ์ผ๊ฐํ
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class _4153 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//memory 11312 runtime 76
while(true){
StringTokenizer st = new StringTokenizer(br.readLine(), " ");
int a = Integer.parseInt(st.nextToken());
int b = Integer.parseInt(st.nextToken());
int c = Integer.parseInt(st.nextToken());
if(a == 0 && b == 0 && c == 0) break;
if((a*a + b*b)== c*c){
System.out.println("right");
}else if(a*a ==(b*b + c*c)){
System.out.println("right");
} else if((a*a + c*c) == b*b){
System.out.println("right");
} else{
System.out.println("wrong");
}
}
}
}
/*
input
6 8 10
25 52 60
5 12 13
0 0 0
output
right
wrong
right
*/