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>
using namespace std;

int main(){

	int n;
	int sd[3];
	int max,m=-1;
	bool isRect=false;
	bool isTri=true;

	cin>>n;

	for(int i=0;i<n;++i){
		cin>>sd[0]>>sd[1]>>sd[2];
		//長辺の判定
		max=0;
		for(int i=0;i<3;++i){
			if(sd[i]==0){isTri=false;}
			if(sd[i]>max){m=i;}
		}

		//直角三角形の判定
		if(isTri){
			switch(m){
			case 0:
				if(sd[0]*sd[0] == (sd[1]*sd[1] + sd[2]*sd[2])){isRect=true;}else{isRect=false;}
				break;
			case 1:
				if(sd[1]*sd[1] == (sd[0]*sd[0] + sd[2]*sd[2])){isRect=true;}else{isRect=false;}
				break;
			case 2:
				if(sd[2]*sd[2] == (sd[1]*sd[1] + sd[0]*sd[0])){isRect=true;}else{isRect=false;}
				break;
			}
		}

		if(isRect){cout<<"YES\n";}else{cout<<"NO\n";}

	}
}

C++: #include <iostream>
using namespace std;
int main(){

	int a;
	int b;
	int c;

	int n;
	cin >> n;

	for(int i=1; i<=n; i++){

		cin >> a >> b >> c;

		if(a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a){

			cout << "YES\n";

		}
		else {
			cout << "NO" << endl;
		}
	}
}

C++: #include <iostream>

using namespace std;

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

int main()
{
	solve();
	return(0);
}

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

int main(){
	int a, b, c, n, lengh[3], ans[1000];
	priority_queue< int > Q;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>b>>c;
		Q.push(a);
		Q.push(b);
		Q.push(c);
		for(int j=0;j<3;j++){
			lengh[j]=Q.top();
			Q.pop();
		}
		int res=lengh[1]*lengh[1]+lengh[2]*lengh[2];
		int res2=lengh[0]*lengh[0];
		if(res==res2){
			ans[i]=1;
		}else{
			ans[i]=0;
		}
	}
	for(int i=0;i<n;i++){
		if(ans[i]==1){
			cout<<"YES"<<endl;
		}else if(ans[i]==0){
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>

int main(void){
  int deta;
  //データ数をもらう
  scanf("%d", &deta);

  //データ数だけ３辺の値をもらう
  for(int i = 0; i < deta; i++){
    int hen1, hen2, hen3;
    scanf("%d", &hen1);
    scanf("%d", &hen2);
    scanf("%d", &hen3);

    //直角三角形の判定
    if(hen1*hen1 + hen2*hen2 == hen3*hen3 ||
       hen2*hen2 + hen3*hen3 == hen1*hen1 ||
       hen3*hen3 + hen1*hen1 == hen2*hen2){
      printf("yes\n");
    }else{
      printf("no\n");
    }

    
  }


  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <set>

using namespace std;

#define ALL(co) co.begin(), co.end()

typedef long long LL;
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> Array;
typedef vector<int> LArray;

const int INF = 1 << 29;
const LL LINF = 1LL << 60;

int itiv;
inline int getInt() { return (cin >> itiv, itiv); }
void readAll(Array& vec, int n) { for (int i = 0; i < n; i++) cin >> vec[i]; }
inline bool between(int first, int last, int n) { return first <= n && n <= last; }
inline bool inRange(int begin, int end, int n) { return begin <= n && n < end; }
inline bool inRange(int size, int n) { return 0 <= n && n < size; }

int m, n;
int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, -1, 0, 1 };
int dr[] = { 0, -1, 0, 1 }, dc[] = { -1, 0, 1, 0 };


int main(void)
{
	while(cin >> n && n)
	{
		for (int i = 0; i < n; i++)
		{
			Array arr(3);
			readAll(arr, n);
			sort(ALL(arr));
			cout << (arr[2] * arr[2] == arr[0] * arr[0] + arr[1] * arr[1] ? "YES" : "NO") << endl;
		}
		return 0;
	}
	return 0;
}

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

int main() {
    int N;
    cin >> N;
    int a, b, c;
    while (N--) {
        cin >> a >> b >> c;
        int l=max(a,max(b,c));
        int x, y;
        if (a==l) {
            x=b; y=c;
        } else if (b==l) {
            x=a; y=c;
        } else if (c==l) {
            x=a; y=b;
        }
        if (l==sqrt(pow(x,2)+pow(y,2))) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }
    return 0;
}

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

int sq(int n){
    return n*n;
}

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

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

int main(void)
{
    int n, a[3];
    bool flag = false;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        scanf("%d %d %d", &a[0], &a[1], &a[2]);
        for (int j = 0; j < 3; ++j) {
            if (a[j] * a[j] == a[(j + 1) % 3] * a[(j + 1) % 3] + a[(j + 2) % 3] * a[(j + 2) % 3]) {
                flag = true;
            }
        }
        if (flag) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
  int N, s1, s2, s3;
  cin >> N;
  for(int i = 0; i < N; ++i) {
	cin >> s1 >> s2 >> s3;
	if(s1*s1 + s2*s2 == s3*s3) cout << "YES" << endl;
	else if(s2*s2 + s3*s3 == s1*s1) cout << "YES" << endl;
	else if(s1*s1 + s3*s3 == s2*s2) cout << "YES" << endl;
	else cout << "NO" << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
    int n,a[3],b[3],l,k;
    cin>>n;
    for(l=0;l<n;l++){
        for(k=0;k<3;k++){
            cin>>a[k];
            if(a[k]>1000||a[k]<=0||l>1000){
                break;
            }
            b[k]=a[k]^2;
        }
        sort(b,b+3);
        if(b[2]==b[0]+b[1]){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}

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

int main()
{
	int n;
	cin >> n;
	while (n--) {
		int a[3] = { 0 };
		for (int i = 0; i < 3; i++)cin >> a[i];
		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 <iostream>
using namespace std;
int main(void){

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

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

int main() {
	int x, n, m, l;
	vector<string> v;
	
	cin >> x;

	for(int i = 0; i < x; i++) {
		cin >> n >> m >> l;

		if(l*l == n*n + m*m) {
			v.push_back("YES");
		} else {
			v.push_back("NO");
		}
	}

	for(int i = 0; i < v.size(); i++) {
		cout << v[i] << endl;
	}

	return 0;
}

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

}
return 0;
}