Go: package main

import "fmt"

func main() {
	var n int

	fmt.Scanf("%d", &n)

	var a, b, c int
	for i := 0; i < n; i++ {
		var isTriangle bool
		fmt.Scanf("%d %d %d", &a, &b, &c)

		if a*a == b*b+c*c || b*b == a*a+c*c || c*c == b*b+a*a {
			isTriangle = true
		}

		if isTriangle == true {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };


int main() {
	int n, d[3];
	scanf( "%d", &n );
	while ( n-- ) {
		for ( int i = 0; i < 3; i++ ) {
			scanf( "%d", &d[ i ] );
		}
		sort( d, d + 3 );
		printf( "%s\n", sq( d[ 0 ] ) + sq( d[ 1 ] ) == sq( d[ 2 ] ) ? "YES" : "NO" );
	}
	return 0;
}

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

int pow2(int i) {
	return std::pow(i, (double) 2);
}

int main() {
	int in[3];
	while (std::cin >> in[0] >> in[1] >> in[2]) {
		std::sort(in, in + 3);
		if (pow2(in[2]) == pow2(in[0]) + pow2(in[1]))
			std::cout << "YES" << std::endl;
		else
			std::cout << "NO" << std::endl;
	}
}

C++: main(a,b,c){for(;~scanf("%d%d%d",&a,&b,&c);puts((a+b-c&&a+c-b&&c+b-a)?"NO":"YES")a*=a,b*=b,c*=c;}

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

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

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int N;
cin >> N;
while(N--){
int i[3],c;
int max;
cin >> i[0] >> i[1] >> i[2];
sort(i,i+3);
cout << ((i[0]*i[0]+i[1]*i[1]==i[2]*i[2])?"YES\n":"NO\n";
}}

C++: #include<stdio.h>
??
int main(void){
????????????????int a,b,c,temp;
????????????????int i,j;
????????????????int N;
??
????????????????scanf("%d",&N);
??
????????????????int k[N][3];
??
????????????????i=0;
??
????????????????while(scanf("%d %d %d",&a,&b,&c)!=EOF){
????????????????????????????????if(a>b){
????????????????????????????????temp=b;
????????????????????????????????b=a;
????????????????????????????????a=temp;
????????????????????????????????}
????????????????????????????????if(b>c){
????????????????????????????????temp=c;
????????????????????????????????c=b;
????????????????????????????????b=temp;
????????????????????????????????}
??
????????????????????????????????k[i][0]=a;
????????????????????????????????k[i][1]=b;
????????????????????????????????k[i][2]=c;
????????????????????????????????i++;
????????????????????????????????if(N==i) break;
??
????????????????}
??
????????????????for(j=0;j<N;j++){
????????????????????????????????if(k[j][2]*k[j][2]==k[j][1]*k[j][1]+k[j][0]*k[j][0]){
????????????????????????????????printf("YES \n");
????????????????????????????????}else{
????????????????????????????????printf("NO \n");
????????????????????????????????}
????????????????}
??
????????????????return 0;
}

C++: #define _USE_MATH_DEFINES
#include <cmath>

#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n;
	int a,b,c;
	
	cin >> n;
	
	while (n)
	{
		cin >> a >> b >> c;
		
		if (pow(c, 2) == pow(a, 2) + pow(b, 2))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
		
		n--;
	}
	return 0;
}

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

int main(int argc, char *argv[]){
    int N,a,b,c;
	cin >> N;
	for (int i = 0; i < N; ++i){
		cin >> a >> b >> c;
		cout << (((a*a+b*b==c*c) || ((a*a+c*c==b*b) || (c*c+b*b==a*a))) ? "YES":"NO") << endl;
	}
    return 0;
}

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

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
    int n , a , b , c ;
    cin >> n ;
    for( int i=0 ; i<n ; i++ ){
        cin >> a >> b >> c;
        a = a*a;
        b = b*b;
        c = c*c;
        int ab=a+b;
        int ac=a+c;
        int bc=b+c;
        if( ab == c ){
            cout << "YES" << endl;
        }
        else if( ac == b ){
            cout << "YES" << endl;
        }
        else if( bc == a ){
            cout << "YES" << endl;
        }
        else
            cout << "NO" << endl;
    }
}

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

C++: /*
AOJ_0003_IsitaRightTriangle?

EOFはWindowsはCtrl+Z,UNIXはCtrl+D

方針
配列入れて昇順ソートして　１番目と２番目の二乗の合計が
三番目の二乗になってるか確かめる。

配列の大きさが３固定なので、multisetに格納するのはもったいない
普通の配列に入れて、sortを使う

*/

#include <iostream>
#include <string>
#include <cstdio>
#include <math.h>
#include <algorithm>

using namespace std;

int main() {
	int N, side[3], i,j;

	cin >> N;

	for (i = 0; i < 3; i++){
		cin >> side[0] >> side[1] >> side[2];
		sort(side, side + 3);

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

C++: #include <stdio.h>
#include <string.h>

typedef struct{
    int m[3];
}triangle;

int main( void ){

    triangle *tri;
    int e;
    scanf( "%d",&e );
    if(( tri = ( triangle * ) malloc( sizeof( triangle ) * e )) == NULL ) return -1;
    for( int i = 0;i < e;i++ )scanf( "%d %d %d",
                                        &tri[i].m[0],&tri[i].m[1],&tri[i].m[2] );

    for( int i = 0;i < e;i++ ){
        for( int k = 0;k < 2;k++ ){
            for( int j = 0;j < 2;j++ ){
                if( tri[i].m[j] => tri[i].m[j+1] ){
                    int buf = tri[i].m[j];
                    tri[i].m[j] = tri[i].m[j+1];
                    tri[i].m[j+1] = buf;
                }
            }
        }
        if( tri[i].m[0] * tri[i].m[0] + tri[i].m[1] * tri[i].m[1] == tri[i].m[2] * tri[i].m[2] ) printf( "YES\n" );   
        else printf( "NO\n" );
    }
    return 0;
}