Go: package main
import (
    "fmt"
    "os"
    "bufio"
    "strconv"
    "sort"
)
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
func main(){
    sc.Split(bufio.ScanWords)
    defer out.Flush()
    n := nextInt()
    for i:=0; i<n; i++{
        data := nextInts(3)
        sort.Ints(data)
        if data[0]*data[0]+data[1]*data[1] == data[2]*data[2]{
            fmt.Fprintln(out, "YES")
        }else{
            fmt.Fprintln(out, "NO")
        }
    }
}
 
func next() string{
    sc.Scan()
    return sc.Text()
}
 
func nextInt() int{
    a, _ := strconv.Atoi(next())
    return a
}
 
func nextInts(n int) []int{
    a := make([]int, n)
    for i:=0; i<n; i++{
        a[i] = nextInt()
    }
    return a
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define MOD 1000000007 //10^9+7
#define INF 1000000000 //10^9

char m[500][500];

int main ()
{
    int H,W;
    cin>>H>>W;
    
    for (int i=0; i<H; i++) {
        for (int j=0; j<W; j++) {
            cin>>m[i][j];
        }
    }
    
    queue<pint < pint > >;
    return 0;
}

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

void swap(int *,int *);
int search(int,int,int);
int correct[201][3];

int main(void)
{
	int a,b,c;
	int i,n;
	scanf("%d",&n);
	for(i=1;i<=200;i++){
		correct[i][0]=3*i;
		correct[i][1]=4*i;
		correct[i][2]=5*i;
	}
	for(i=0;i<n;i++){
		scanf("%d %d %d",&a,&b,&c);
		if(b<a)swap(&a,&b);
		if(c<b)swap(&b,&c);
		if(b<a)swap(&a,&b);
		if( search(a,b,c) ) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

void swap(int *a,int *b){
	int work;
	work=*a;
	*a=*b;
	*b=work;
}

int search(int a,int b,int c){
	int i;
	for(i=1;i<201;i++){
		if( (correct[i][0]==a) && (correct[i][1]==b) && (correct[i][2]==c) ) return 1;
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

int main()
{
	int n;
	int a,b,c;

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

}

C++: #include <stdio.h>
int main()
{
	int a,b,c,n;
	while(scanf("%d",&n)==1){
		for(int i =0;i<n;i++){
			scanf("%d %d %d",&a,&b,&c);
				if((((a*a)+(b*b))==(c*c)) )
					printf("YES\n");
				else
					printf("NO\n");
		}
	}
	return 0;
}

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

using namespace std;

int main() {
    int n; scanf("%d", &n);
    
    for(int i = 0; i < n; ++i) {
    	int s[3]; scanf("%d %d %d", &s[0], &s[1], &s[2]);
    	
    	sort(s, s + 3);
    	
    	int a=s[0], b=s[1], c=s[2];
    	
    	if (c*c == (a*a)+(b*b)) puts("YES");
    	else puts("NO");
    }
}

C++: #include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
using namespace std;
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    int a,b,c;
    cin>>a>>b>>c;
    if((a*a+b*b==c*c)||(b*b+c*c==a*a)||(c*c+a*a==b*b)){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;   
}

C++: #include<stdio.h>

int main(){
  int N = 0 ,i,j,k,tmp = 0;
  int tri[3] = {0,0,0};
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d %d %d",&tri[0],&tri[1],&tri[2]);
    for(j = 0;j <= 2;j++){
      for(k = j + 1;k <= 2;k++){
	tmp = tri[j];
	tri[j] = tri[k];
	tri[k] = tmp;
      }
    }
    if(tri[0] * tri[0] == tri[1] * tri[1] + tri[2] * tri[2]){
      printf("YES\n");
    }
    else{
      printf("NO\n");
    }
  }
  return 0;
}

C++: #include <stdio.h>
int main()
{
  int a,b,c,sum,i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d %d %d",&a,&b,&c);
    a=a*a;
    b=b*b;
    c=c*c;
    sum=a+b+c;
    if(a=1&&b=1&&c=1){
      printf("NO\n");
    }else if(sum/2==a||sum/2==b||sum/2==c)printf("YES\n");
    else printf("NO\n");
  }

  return 0;
}

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

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

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

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		vector<int> vec(3);
		for (int j = 0; j < 3; j++) {
			cin >> vec[j];
		}
		sort(vec.begin(), vec.end());
		if (pow(vec[0], 2) + pow(vec[1], 2) == pow(vec[2], 2)) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n,j=0;
  int a[3];
  cin>>n;
  while(j<n){
    for(int i=0;i<3;i++){
      cin>>a[i];
    }
    sort(a,a+3);
    if(a[2]*a[2]==a[1]*a[1]+a[0]*a[0]){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  j++;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

bool isright(int a, int b, int c) {
    if (a*a + b*b == c*c) return true;
    if (a*a + c*c == b*b) return true;
    if (c*c + b*b == a*a) return true;
    return false;
}

int main() {
    int n;
    cin >> n;
    REP(i,n) {
        int a, b, c;
        cin >> a >> b >> c;
        if (isright(a,b,c)) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a[3];
while(cin >>a[0]>>a[1]>>a[2]){
sort(a,a+3);
if((a[0] * a[0]) + (a[1] * a[1] ) == (a[2] * a[2])) cout << "yes" << endl;
else cout << "no"<<endl;
}
return 0;
}

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

using namespace std;

int main(void)
{
	int a[3];
	int n;
	
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		for (int j = 0; j < 3; j++){
			scanf("%d", &a[j]);
		}
		
		sort(a, a + 3);
		
		if (a[0] * a[0] == a[1] * a[1] + a[2] * a[2]){
			puts("YES");
		}
		else {
			puts("NO");
		}
	}
	
	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, greater<int>());

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

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

int main(){
  int N,i,a,b,c;

  scanf("%d",&N);
  for(i = 0;i<N;i++){
    cin >> a >> b >> c;
    a*=a;
    b*=b;
    c*=c;
    if(a+b==c||b+c==a||a+c==b)cout << "YES" << endl;
    else cout << "NO" << endl;

}
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int N;
int a[3]; 
int b,c,d;

int main() {
  for (int i = 0; i < N; ++i) {
    scanf("%d %d %d",a[1],a[2],a[3]);
    sort(a,a+3);
    b = a[1]*a[1];
    c = a[2]*a[2];
    d = a[3]*a[3];
    if ( b + c = d ) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  
}