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<iostream>
int main(){
	int N;
	int a, b, c;
	std::cin >> N;
	for(int i = 0; i < N; i++){
		std::cin >> a >> b >> c;
		if (a*a == b*b + c*c || b*b == a*a + c*c || c*c == a*a + b*b){
			std::cout << "YES" << std::endl;
		}
		else{
			std::cout << "NO" << std::endl;
		}
	}
	return 0;
}

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

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

C++: #include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
using namespace std;
int size(string x){
	string::size_type size=x.size();
	return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define fi first
#define se second
typedef  vector<string> vs;
typedef  vector<int> vi;
double pi(){
	return M_PI;
}
typedef set<int> set_i;
typedef set<string> set_s;
int main(){
	int n;
	cin>>n;
	fu(0,n){
		vi a(3,0);
		cin>>a[0]>>a[1]>>a[2];
		sort(a.rbegin(), a.rend());
		if(a[0]*a[0]==a[1]*a[1]+a[2]*a[2]) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cctype>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <memory>
#include <functional>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int j=0;j<n;j++){
		int dat[4];
		cin>>dat[0]>>dat[1]>>dat[2];
		for(int i=0;i<3;i++){
			if(dat[i]*dat[i]==dat[0]*dat[0]+dat[1]*dat[1]+dat[2]*dat[2]-dat[i]*dat[i]){
				cout<<"YES"<<endl;
				i=4;
			}
			if(i==2){
				cout<<"NO"<<endl;
			}
		}
	}
	return 0;
}

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

	}
    return 0;
	
}

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

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

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

using namespace std;

int main()
{
	int num;

	cin >> num;
	if(num > 1000)
		return -1;

	for(int ix = 0;ix != num;++ix){
		int set[3];
		cin >> set[0] >> set[1] >> set[2];

		if(set[0]<1 || set[1]<1 || set[2]<1 || set[0]>1000 || set[1]>1000 || set[2]>1000)
			break;

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

	return 0;
}

C++: #include <iostream>
//#include <cstdio>
//#include <cmath>
using namespace std;
 
//0003
int main(){
	int n;
	int a, b, c, a2, b2, c2;
	cin >> n;
	while(n--){
		cin >> a >> b >> c;
		a2 = a*a;
		b2 = b*b;
		c2 = c*c;

		if(a==b && b==c){
			cout << "NO" << endl;
			break;
		}
		if(a2==b2+c2 || b2==a2+c2 || c2==a2+b2){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include<stdio.h>
int main()
{
    int a,b,c,n,i;
    while(scanf("%d",&n)!=EOF){
    for(i=1;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<stdio.h>
int main(void)
{
	int n=1;
	int i=0;
	int a,b,c;
	int irekae=0;
	
	while(n!=0)
	{
		scanf("%d",&n);
		if (n==0)
		{
			break;
		}
	for (i=1;i<=n;i++)
	{
		scanf("%d",&a);
		scanf("%d",&b);
		if (a<b)
		{
			irekae=a;
			a=b;
			b=irekae;
		}
		scanf("%d",&c);
		if (a>c)
		{
			irekae=a;
			a=c;
			c=irekae;
		}
		if (c*c==a*a+b*b)
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}
	}
	return 0;
}

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

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

  cin >> N;
    
    if(N <= 0 || N > 1000)
        cout << endl;
    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{
    if(a+b>c && b+c>a && c+a>b){
        x[n]="YES";
    }
    else{
        x[n]="NO";
    }
            N--;
            n++;
            break;
        }
  }
}
    for(int i = 0;i < n;i++)
        cout << x[i] << endl;
    
  return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
	int a = 0;
	int kazu = 0;
	int b = 0;
	int c = 0;
	cin >> kazu;
	for (int i = 0; i < kazu; i++)
	{
		cin >> a;
		cin >> b;
		cin >> c;
		if (a * a + b * b == c * c)
		{
			cout << "YES" << endl;
		}
		else if (a * a + c * c == b * b)
		{
			cout << "YES" << endl;
		}
		else if (c * c + b * b == a * a)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

int main()
{
	int a,b,c,d,x;
	cin >> d;
	for (x = 1; x <= d; x++)
	{
		cin >> a>>b>>c;
		if (a < b + c&&b < a + c&&c < a + b&&a>b - c&&b>a - c&&c>a - b&&a>c-b&&b>c-a&&c>b-a)
				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<iostream>
#include<algorithm>
#include<vector>
#include<cmath>


using namespace std;

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

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int a,b,c;
		vector<int> hoge;
		cin>>a>>b>>c;

		
		cout<< ( ( check(a,b,c) || check(c,a,b) || check(b,c,a))==true ? "YES" : "NO")<<endl;
	}
	return 0;
}

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

int main(){
    float a[1000], b[1000], c[1000];
    int n, i;

    cin>>n;
    for(i=0; i<n; i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(i=0; i<n; i++){
        if((b[i] + c[i]) / 2 == a[i] and a[i] != c[i]){
            cout<<endl<<"YES";}
        else{
            cout<<endl<<"NO";
        }
    }
    return 0;
}