Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	// sc.Split(bufio.ScanLines)
	sc.Split(bufio.ScanWords)
	n, _ := strconv.Atoi(read())
	s := make([]int, 3)
	for i := 0; i < n; i++ {
		s[0], _ = strconv.Atoi(read())
		s[1], _ = strconv.Atoi(read())
		s[2], _ = strconv.Atoi(read())
		sort.Sort(sort.IntSlice(s))
		if (s[2] * s[2]) == ((s[0] * s[0]) + (s[1] * s[1])) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include<iostream>
using namespace std;
int dd(int x){
	int y;
	y = x * x;
	return y;
}
int main(){
	int n;
	int a, b ,c;
	cin >> n;
	while(n > 0){
		cin >> a;
		cin >> b;
		cin >> c;
		if((dd(a) + dd(b) == dd(c)) || (dd(b) + dd(c) == dd(a)) || (dd(c) + dd(a) == dd(b))){
			cout << "YES\n";
		}else{
			cout << "NO\n";
		}
		n--;
	}
}

C++: #include <bits/stdc++.h>
//#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007LL
#define INF (1LL<<60LL)
#define int long long
typedef long long ll;

using namespace std;



signed main() {
	ll n; cin >> n;
	rep(i, n) {
		vector<ll> v(3);
		rep(i, 3) cin >> v[i];
		sort(all(v));
		if (pow(v[0], 2) + pow(v[1], 2) == pow(v[2], 2)) {
			cout << "YES" << endl;
		}
		else cout << "NO" << endl;
	}
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <math.h>
using namespace std;

int main(){
	int N;
	cin >> N;
	string line;
	cout << endl;
	for (int i = 0; i < N; i++){
		getline(cin, line);
		stringstream lineStream(line);
		int a, b, c;
		lineStream >> a >> b >> c;
		int a_two = pow(a, 2);
		int b_two = pow(b, 2);
		int c_two = pow(c, 2);
		if ((a_two + b_two == c_two) || (b_two + c_two == a_two) || (c_two + a_two == b_two)){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
    return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
void solve(int a, int b, int c) {
    bool f = false;
    int max_num = max(a, max(b, c));
    int sub1, sub2;
    if (max_num != a) {
        sub1 = a;
        if (max_num != b) sub2 = b;
        else sub2 = c;
    } else if (max_num != b) {
        sub1 = b;
        sub2 = c;
    }         
    if (pow(max_num, 2) == pow(sub1, 2) + pow(sub2, 2)) f = true;
    if (f) cout << "YES" << endl;
    else cout << "NO" << endl;
}
int main() {
    int num, a, b, c;
    cin >> num;
    for (int i=0; i<num; i++) {
        cin >> a >> b >> c;
        solve(a,b,c);
    }
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
  int num[3],n;
  cin >> n;
  for(int i= 0;i<n;i++){
    cin >> num[0] >> num[1] >> num[2];
    sort(num,num+3);
    if((num[1] * num[1]) + (num[0] * num[0]) == num[2] * num[2]){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
    
  }
}

C++: 
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

#define rep(i,n) for(int i = 0; i < n; i++)
#define REP(i,j,n) for(int i = j; i < n; i++)


int main(){

	int N = 0;
	cin >> N;
	vector<double> data(N);

	rep(i,N){
		rep(j,3){
			cin >> data[j];
		}

		sort(data.begin(),data.end());

		if(pow(data[2],2) == pow(data[0],2) + pow(data[1],2)){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}

	}

	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
	EACH(x,vec) is >> x;
	return is;
}
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
	REP(i,vec.size()) {
		if (i) os << " ";
		os << vec[i];
	}
	return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
	REP(i,vec.size()) {
		if (i) os << endl;
		os << vec[i];
	}
	return os;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int N; cin >> N;
	REP(t, N) {
		vector<int> v(3); cin >> v;
		sort(ALL(v));
		if (v[0] * v[0] + v[1] * v[1] == v[2] * v[2]) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
}

C++: #include<stdio.h>
 
main()
{
    int d,e;
 
    scanf("%d",&d); //入力するデータセット数
 
    for(e=0;e<d;e++){
        int a=0,b=0,c=0;
 
        scanf("%d %d %d",&a,&b,&c);
        
        if( (a*a) + (b*b) == (c*c) ||
            (b*b) + (c*c) == (a*a) ||
            (c*c) + (a*a) == (b*b))
            printf("YES\n");
        else
            printf("NO\n");
    }
 return 0;
}

C++: //AOJ0003 Is it a Right Triangle?
#include <stdio.h>

int main(){
	int i,num[3],line;
	scanf("%d",&line);
	for(i = 0; i < line; i++){
		if(scanf("%d %d %d",&num[0],&num[1],&num[2]) == EOF)break;
		if(num[0]^2 == num[1]^2+num[2]^2 || num[1]^2 == num[0]^2+num[2]^2 || num[2]^2 == num[0]^2+num[1]^2)
			printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

C++: #include<iostream>
using namespace std;

int main()
{
	int a, b, c,n;
	cin >> n;
	for (int i = 0;i < n;i++) {
		cin >> a >> b >> c;
		if (a >= b&&a >= c) {
			if (a*a == b * b + c * c)
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
		if (b >= a&&b >= c) {
			if (b*b == a * a + c * c)
				cout << "YES" << endl;
			else
				cout<< "NO" << endl;
		}
		else {
			if (c*c == a * a + b * b)
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
	}
    return 0;
}

C++: #include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
	int a,b[3]={0};
	cin>>a;
	for (int A=0;A<a;A++){
		cin>>b[0]>>b[1]>>b[2];
		sort(b,b+3);
		b[0]=pow(b[0],2);
		b[1]=pow(b[1],2);
		b[2]=pow(b[2],2);
		if (b[2]==b[0]+b[1])cout<<"Yes"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <complex>
#include <cmath>
#include <algorithm>
#include <map>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
int main(){
	int num,x,y,z;
	vector<int> tmp1,tmp2,tmp3;
	cin>>num;
	for(int i=0;i<num;i++){
		cin>>x>>y>>z;
		tmp1.push_back(x);
		tmp2.push_back(y);
		tmp3.push_back(z);
	}
	for(int i=0;i<num;i++){
		tmp1[i]*=tmp1[i];
		tmp2[i]*=tmp2[i];
		tmp3[i]*=tmp3[i];
		int high=max(tmp1[i],max(tmp2[i],tmp3[i]));
		int sum=tmp1[i]+tmp2[i]+tmp3[i];
		if(high==sum/2) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
}

C++: /*
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0003
 */
#include <cmath>
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>

using namespace std;

int
main()
{
	string line;
	while (getline(cin, line)) {
		vector<int> sides(3);
		istringstream iss(line);
		for ( int i = 0; i < 3; i++ ) iss >> sides[i];
		sort( sides.begin(), sides.end() );
		int test = pow( sides[0], 2 ) + pow( sides[1], 2 ) - pow( sides[2], 2 );
		cout << ( test == 0 ? "YES" : "NO" ) << endl;
	}
}