-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4153.cpp
More file actions
32 lines (30 loc) · 778 Bytes
/
Copy path4153.cpp
File metadata and controls
32 lines (30 loc) · 778 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
#include <iostream>
#include <math.h>
using namespace std;
int main(){
while(1){
int a,b,c; cin >> a >> b >> c;
if(a==0 && b==0 && c==0)
break;
if(a<c&&b<c){
if(pow(a,2) + pow(b,2) == pow(c,2))
cout << "right" << endl;
else
cout << "wrong"<< endl;
}
else if(c<b&&a<b){
if(pow(a,2) + pow(c,2) == pow(b,2))
cout << "right" << endl;
else
cout << "wrong"<< endl;
}
else if(c<a&&b<a){
if(pow(c,2) + pow(b,2) == pow(a,2))
cout << "right" << endl;
else
cout << "wrong"<< endl;
}
else
cout << "wrong"<< endl;
}
}