Skip to content

Instantly share code, notes, and snippets.

@theoremoon
Created February 9, 2015 20:14
Show Gist options
  • Save theoremoon/fa0ea9507be8901f364a to your computer and use it in GitHub Desktop.
Save theoremoon/fa0ea9507be8901f364a to your computer and use it in GitHub Desktop.
/*
* 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