Go: package main

import (
  "fmt"
)


func main() {
  var a int
  var b int
  var c int
  var n int
  fmt.Scan(&n)
  for _, err := fmt.Scan(&a, &b, &c); err == nil; _, err = fmt.Scan(&a, &b, &c) {
    if a*a == b*b+c*c {
      fmt.Println("YES")
    } else if b*b == c*c+a*a {
      fmt.Println("YES")
    } else if c*c == a*a+b*b {
      fmt.Println("YES")
    } else {
      fmt.Println("NO")
    }
  }
}

C++: #include <stdio.h>

enum {YES, NO} y_n;

int tri_judge(int x, int y, int z);
int pow2(int x);

int main(void)
{
    int dataset;
    scanf("%d", &dataset);

    int side1, side2, side3;
    while (dataset--){
        scanf("%d %d %d", &side1, &side2, &side3);
        y_n = tri_judge(side1, side2, side3);
        if (y_n == YES){
            printf("YES\n");
        } else {
            printf("NO\n");
        }

    }

    return 0;
}

int tri_judge(int x, int y, int z)
{
    if (pow2(x) == pow2(y) + pow2(z)){
        y_n = YES;
    } else if (pow2(y) == pow2(z) + pow2(x)){
        y_n = YES;
    } else if (pow2(z) == pow2(x) + pow2(y)){
        y_n = YES;
    } else {
        y_n = NO;
    }

    return y_n;
}

int pow2(int x)
{
    return x * x;
}

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<stdio.h>
#include<math.h>

int main(void){
  int a[10],b[10],c[10],i,j;
  scanf("%d",&i);
  for(j=0;j<i;j++){
    scanf("%d %d %d",&a[j],&b[j],&c[j]);
  }
  for(j=0;j<i;j++){
    if((a[j]*a[j]+ b[j]*b[j] == c[j]*c[j])||(a[j]*a[j] + c[j]*c[j] == b[j]*b[j])||(b[j]*b[j]+c[j]*c[j] ==a[j]*a[j])){
      printf("%d %d %d\n",a[j],b[j],c[j]);
      printf("YES\n");
    }
    else
      printf("NO\n");
  }
  return 0;
}

C++: #include<cstdio>
int main()
{
	int N;
	scanf("%d", &N);
	while(N--)
	{
		int a, b, c;
		scanf("%d%d%d", &a, &b, &c);
		if(a > b)
		{
			a = a ^ b;
			b = a ^ b;
			a = a ^ b;
		}
		if(a > c)
		{
			a = a ^ c;
			c = a ^ c;
			a = a ^ c;
		}
		if(b > c)
		{
			b = b ^ c;
			c = b ^ c;
			b = b ^ c;
		}
		if(a + b > c && a * a + b * b == c * c)
		{
			printf("YES\n");
		}
		else printf("NO\n");
	}
	return 0;
}

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

string Judge_triangle(int a,int b,int c){
    if(a+b>c && b+c>a && c+a>b){
        return "YES";
    }
    else{
        return "NO";
    }
}

int main(){
  int N;
  int a,b,c;
  int n=0;
    
    while(1){

  cin >> N;
    
        if(N <= 0 || N > 1000){
            
        }
    else
        break;
    }
    
    string x[N];

while(N > 0 && cin >> a >> b >> c){
    
    
    while(1){
        if(a < 1 || a > 1000 || b < 1 || b > 1000 || c < 1 || c > 1000){
            
            break;
        }
        
        else{
            x[N-1] = Judge_triangle(a,b,c);
            N--;
            n++;
            break;
        }
  }
}
    for(int i = 0;i < n;i++)
        cout << x[i] << endl;
    
  return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int n;
    cin>>n;
    while(n--)
    {
        int a[3];
        for(int 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])
            printf("YES\n");
        else
            printf("NO\n");
    }
}

C++: //-------------
//include
//-------------
#include <map>
#include <list>
#include <cmath>
#include <vector>
#include <string>
#include <cctype>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
//-------------
//typedef
//-------------
typedef  long long LL;
typedef  vector<int> VI;
typedef  vector<double> VD;
typedef  string STR;
typedef  pair<int, int> PII;
typedef  vector<int, int> VII;
typedef  map<string, int> MSI;
//-------------
//utillty
//-------------
#define ALL(a)  (a).begin(),(a).end()
#define MK make_pair
#define PB push_back
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define COUT(a) cout<<a<<endl
#define POW2(a) pow(a, 2.0)
//-------------
//repetition
//-------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//-------------
//debug
//-------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define dumpl(c) REP(i,SZ(c))cerr<<#c<<i<<"="<<(c[i])<<endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const int MOD = 1000000007;
int main()
{
	int x;
	cin >> x;
	REP(i,x)
	{
		VD tri;
		REP(i, 3)
		{
			double temp;
			tri.push_back(temp);
		}
		SORT(tri);
		if (POW2(tri[2]) == sqrt(POW2(tri[0]) + POW2(tri[1])))
		{
			COUT("YES");
		}
		else
		{
			COUT("NO");
		}
	}
	
#ifdef _DEBUG
	while(1);
#endif // _DEBUG

	return 0;
}

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

int main(){

int i,j,d,n1,n2,n3,k,temp;



   cout << "データセットの数を入力してください。(データセットの数 <= 1000):";
   cin >> d;
   while(d <= 0 or d >= 1000){
       cout << "データセットの数 <= 1000を満たしておりません。もう一度入力してください。\n";  
       cout << "データセットの数を入力してください。(データセットの数 <= 1000):";
       cin >> d;
   }
 

 
 int l[d][3];
 

//入力
for(i=0; i<d; i++){
   cout << "3辺の長さを入力してください。(辺の長さは1以上1000以下)";
   cin >> n1 >> n2 >> n3;
   
   if(n1 >= 1 and n1 <= 1000 and n2 >= 1 and n2 <=1000 and n3 >= 1 and n3 <= 1000){
       l[i][0]=n1;
       l[i][1]=n2;
       l[i][2]=n3;
        for (k = 0; k < 2; k++) {
        for (j = 2; j > k; j--) {
            if (l[j - 1] > l[j]) {  
                temp = l[i][j];  
                l[i][j] = l[i][j - 1];
                l[i][j - 1] = temp;
            }
        }
    }
   }else{
   cout << "入力した整数が条件をを満たしておりません。もう一度入力してください。\n";
   i--;
   }
}

    
//出力
cout << "result\n";
for (i = 0; i < d; i++) {
    if(l[i][2]*l[i][2] == (l[i][1]*l[i][1]+l[i][0]*l[i][0])){
    cout << "YES\n";
    }else{
    cout << "NO\n";
    }
}

    return 0;
}

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

int main(){
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		int e[3];
		cin >> e[0] >> e[1] >> e[2];
		sort(e, e+3);
		if(e[0]*e[0] +e[1]*e[1] == e[2]*e[2]){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <math.h>

using namespace std;

int main()
{
	int set = 0, s[1001][3];

	cin >> set;
	for(int i = 0; i < set; i++){
		cin >> s[i][0] >> s[i][1] >> s[i][2];
	}

	for(int i = 0; i < set; i++){

		sort(s[i] , s[i] + 3);

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

	return 0;
}

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

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

  return 0;
}

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

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