Go: package main
import (
        "fmt"
)

func main() {
        var num int
        fmt.Scan(&num)

        for i := 0; i < num; i++ {
                s1 := 0
                s2 := 0
                s3 := 0
                var chk int = 0
                fmt.Scanf("%d %d %d", &s1, &s2, &s3)
                if s1 >= s2 {
                        if s1 > s3 {
                                chk = 1
                        } else {
                                chk = 3
                        }
                } else {
                        if s2 >= s3 {
                                chk = 2
                        } else {
                                chk = 3
                        }
                }

                if (chk == 1 && s1*s1 == s2*s2 + s3*s3) ||
                        (chk == 2 && s2*s2 == s3*s3 + s1*s1) ||
                        (chk == 3 && s3*s3 == s1*s1 + s2*s2) {
                        fmt.Printf("YES\n")
                } else {
                        fmt.Printf("NO\n")
                }
        }
}

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;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,x); REP(i,sizeof(a)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

#define umap unordered_map
//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}

int main(){
  int N; cin>>N;
  REP(i,N){
    int a,b,c; cin>>a>>b>>c;
    if(a>b){ swap(a,b);}
    if(b>c){ swap(b,c);}
    cout<<( a*a+b*b==c*c ? LINY:LINN);
  }
}

C++: #include <stdio.h>

int main(void)
{
	int n;
	int i;
	int x, y, z;

	while (scanf("%d", &n) != EOF){
		for (i = 0; i < n; i++){
			scanf("%d %d %d", &x, &y, &z);

			if ((x * x == y * y + z * z) || (y * y == x * x + z * z) || (z * z == x * x + y * y)){
				printf("YES\n");
			}
			else {
				printf("NO\n");
			}
		}
	}
	return (0);
}

C++: #include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n; cin >> n;
  for ( int i = 0; i < n; i++ ) {
    int a,b,c; cin >> a >> b >> c;
    bool flag = 0;
    if ( a + b > c && b + c > a && c + a > b ) {
      if ( a * a == b * b + c * c ||
       b * b == c * c + a * a ||
       c * c == a * a + b * b ) flag = 1;
    }
    if ( flag ) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

C++: #include <string>
#include <sstream>
#include <iostream>
#include <stack>
#include <queue>
#include <vector>
using namespace std;

vector<string> exinputstring(){
	vector<string> ss;
	string s;
	while(getline(cin,s) ){
		ss.push_back(s);
	}
	
	return ss;
}
vector<int> exinputint(){
	vector<int> ss;
	int d;
	while( !cin.eof() ) {
		cin >>d;
		ss.push_back(d);
	}
	return ss;
}

main(){
	vector<int> inp=exinputint();
	vector<int>::iterator it = inp.begin();
	for (it++;it != inp.end();){
		int a=*it;it++;
		int b=*it;it++;
		int c=*it;it++;
		if ((a>=b&&b>=c&&a*a==b*b+c*c)||
			(b>=a&&b>=c&&b*b==a*a+c*c)||
			(c>=a&&c>=b&&c*c==a*a+b*b)){
				cout<<"YES";}else{cout<<"NO";}

	}
}