Go: package main

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

var (
	sc = bufio.NewScanner(os.Stdin)
)

func main() {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	for i := 0; i < n; i++ {
		sc.Scan()
		edges := make([]int, 3, 3)
		cols := sort.StringSlice(strings.Split(sc.Text(), " "))
		cols.Sort()
		for i, c := range cols {
			edges[i], _ = strconv.Atoi(c)
			edges[i] = int(math.Pow(float64(edges[i]), 2))
		}
		msg := "NO"
		if edges[2] == edges[0]+edges[1] {
			msg = "YES"
		}
		fmt.Println(msg)
	}
}

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 <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>

using namespace std;


int main(){
	int N;
	cin >> N;

	int a[3];
	int i,j;

	for(j=0 ; j<N ; j++){

		for(i=0 ; i<3 ; i++){
			cin >> a[i];
		}

		sort(a, a+3);

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

	}
	return 0;
}

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

C++: #include <iostream>
#include <cstdlib>
#include <stdio.h>
#include <cmath>

using namespace std;


int main(){
    int a, b, c;
    char* str;
    str = (char*)malloc(sizeof(char) * 50);

    if(fgets(str, 50, stdin) == NULL) return 0; // 読み捨て

    while(fgets(str, 50, stdin) != NULL) {
        if(!strcmp("", str)) break;

        sscanf(str, "%d%d%d", &a, &b, &c);
        a = pow(a, 2);
        b = pow(b, 2);
        c = pow(c, 2);

        cout << ((a + b == c || b + c == a || b + c == a) ? "YES" : "NO") << endl;
    }

    return 0;
}

C++: #include<stdio.h>
int main(){
	int n,k[100]={ 0 };
	int a,b,c;
	int i;
	
	scanf("%d",&n);
	for(i=0;i<n;){
		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){k[i]=1;}
		i++;
	}
	for(i=0;i<n;i++){
		if(k[i]==1){printf("YES\n");}
		else{printf("NO\n");}
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,i,w,a,s,d,x,j,z;
		scanf("%\n",&n);
		for(i=0;i<n;i++){
			scanf("%d %d %d",&a,&s,&d);
			if(a>s&&d<a){
				w=(d*d)+(s*s);
				x=a*a;
					if(w==x){
						printf("YES\n");
					}
					else{
						printf("NO\n");
					}	
			}	
			if(a<d&&d>s){
				w=(a*a)+(s*s);
				x=d*d;
					if(w==x){
						printf("YES\n");
					}
					else{
						printf("NO\n");
					}				
			}
			if(a<s&&s>d){
				w=(d*d)+(s*s);
				x=s*s;
					if(w==x){
						printf("YES\n");
					}
					else{
						printf("NO\n");
					}				
			}
			if(a==s&&s==d){
				printf("NO\n");
			}	
		
		}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int x,y,z,n=0,v,m;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>x>>y>>z;
		for(int e=0;e<3;e++){
			if(z<y){
				v=y;
				m=z;
				z=v;
				y=m;
			}else if(z<x){
				v=x;
				m=z;
				z=v;
				x=m;
			}
		}
	 if(z*z==y*y+x*x){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
return 0;
}

C++: #include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
    size_t N;
    scanf("%zu", &N);

    for (size_t i=0; i<N; ++i) {
        vector<int> a(3);
        for (size_t i=0; i<3; ++i)
            scanf("%d", &a[i]);

        sort(a.begin(), a.end());
        printf("%s\n", (a[0]*a[0]+a[1]*a[1]==a[2]*a[2])? "YES":"NO");
    }

    return 0;
}

C++: #include<iostream>

int main(){
	int a,b,c;
	std::cin>>a>>b>>c
	if(a*a+b*b==c*c){
		std::cout<<"YES";
	}else if(a*a+c*c==b*b){
		std::cout<<"YES";
	}else if(b*b+c*c==a*a){
		std::cout<<"YES";
	}else{
		std::cout<<"NO";	
}
	return 0;
}

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

int main()
{
	int N;
	cin >> N;
	int A[3];
	for (int i = 0; i < N; i++) {
		bool f = false;
		for (int j = 0; j < N; j++) {
			cin >> A[j];
		}
		sort(A, A + 3);
		if ((A[0] * A[0] + A[1] * A[1]) == (A[2] * A[2]))
			f = true;
		if(f)
			cout << "YES" << endl;
		else
			cout << "NO"<<endl;
	}
    return 0;
}

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

C++: #include<iostream>

using namespace std;

void swapof3(int&, int&, int&);
void swap(int&, int&);

int main(){
  int i, n;
  int a, b, c, d, e;
  cin >> n;

  for(i=0; i<n; ++i){
    cin >> a >> b >> c;

    swapof3(a, b, c);
    d = a*a + b*b;
    e = c*c;

    if(d == e)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}

void swapof3(int& a, int& b, int& c){
  if(a > b)
    swap(a, b);
  if(b > c)
    swap(b, c);
}

void swap(int& i, int& j){
  int k;
  k = i;
  i = j;
  j = k;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main( void )
{
  int n,x,y,z;
  cin >> n;
  for( int i=0; i<n; i++ ){
    cin >> x >> y >> z;
    if( cin.eof() ) break;
    if( x > y ) swap( x, y );
    if( x > z ) swap( x, z );
    if( y > z ) swap( y, z );
    if( x*x + y*y == z*z ) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}