Created
February 9, 2015 20:14
-
-
Save theoremoon/fa0ea9507be8901f364a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* AOJ 3 | |
* Is it a Right Triangle? (PCK 2003) | |
* AC | |
*/ | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main() { | |
int n; cin >> n; | |
for (int j = 0; j < n; ++j){ | |
int edges[3]; | |
for (int i = 0; i < 3; ++i) | |
cin >> edges[i]; | |
sort(edges, edges+3); | |
if (edges[0]*edges[0] + edges[1]*edges[1] == edges[2]*edges[2]) | |
cout << "YES" << endl; | |
else | |
cout << "NO" << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment