Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	num := int(n)
	var strs []string
	var a, b, c int
	var res string
	var YES string = "YES"
	var NO string = "NO"
	for i := 0; i < num; i++ {
		scanner.Scan()
		strs = strings.Split(scanner.Text(), " ")
		a, _ = strconv.Atoi(strs[0])
		b, _ = strconv.Atoi(strs[1])
		c, _ = strconv.Atoi(strs[2])

		res = NO
		if c*c == (a*a+b*b) || b*b == (a*a+c*c) || a*a == (b*b+c*c) {
			res = YES
		}
		fmt.Printf("%s\n", res)
	}
}

C++: #include <iostream>
#include <string>
#include <cmath>
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";
    }
}

bool Judge_line(int x){
    if(1<=x || x<=1000 || ceil(x) == floor(x))
        return false;
    else
        return true;
}

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

  cin >> N;
    
        if(N > 1000 || ceil(N) != floor(N)){
            
        }
    else
        break;
    }
    
    string x[N];

while(N > 0 && cin >> a >> b >> c){
    
    
    while(1){
        if(Judge_line(a) && Judge_line(b) && Judge_line(c)){
            
            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<iostream>
#include<math.h>
using namespace std;

int main(){
    int times;
    cin >> times;

    for (int i = 0;i < times; i++) {
        int a, b, c;
        cin >> a >> b >> c;

        double a2, b2, c2;
        a2 = pow(a,2);
        b2 = pow(b,2);
        c2 = pow(c,2);

        if (a2 == b2 + c2 || b2 == a2 + c2 || c2 == a2 + b2) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }

    return 0;
}

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

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

	cin >> num;

	int* bat = new int[ num * 3 ];

	for( int i = 0; i < num; ++i ) {
		cin >> bat[ i*3 + 0 ] >> bat[ i*3 + 1 ] >> bat[ i*3 + 2 ];
	}

	for( int i = 0; i < num; ++i ) {
		a = bat[ i*3 + 0 ];
		b = bat[ i*3 + 1 ];
		c = bat[ i*3 + 2 ];
		if ( a < b ) {
			int t = a;
			a = b;
			b = t;
		}
		if ( a < c ) {
			int t = a;
			a = c;
			c = t;
		}
		
		if ( !( a*a - ( b*b + c*c ) ) ) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}

	delete[] bat;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,n,i;

	scanf("%d",&n);
	
	for(i=0;i<n;i++){
	
		scanf("%d %d %d",&a,&b,&c);

		if(a*a==b*b+c*c || b*b==a*a+c*c || c*c==a*a+b*b){
		printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}

	return 0;
}

C++: #include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
	int a,b[3]={0};
	cin>>a;
	for (int A=0;A<a;A++){
		cin>>b[0]>>b[1]>>b[2];
		sort(b,b+3);
		b[0]=pow(b[0],2);
		b[1]=pow(b[1],2);
		b[2]=pow(b[2],2);
		if (b[0]==24) b[0]+=1;
		if (b[1]==24) b[1]+=1;
		if (b[2]==24) b[2]+=1;
		if (b[2]!=b[0]+b[1]) cout<<"No"<<endl;
		else cout<<"Yes"<<endl;
	}
	return 0;
}

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

#define N 1000

struct{int a[3];} d[N];

int main(){
    int i,j,L;
    int longest,small;

    for(i=0; i<N,scanf("%d %d %d",&d[i].a[0],&d[i].a[1],&d[i].a[2])!=EOF; i++);
    L=i;
    for(i=0;i<L;i++){        
        longest=0;
        for(j=0;j<3;j++)
            if(longest<d[i].a[j])
                longest=d[i].a[j];
        for(j=0;j<3;j++)
            if(d[i].a[j]!=longest)
                small+=pow(d[i].a[j],2);
        if(small==pow(longest,2))
            printf("YES");
        else
            printf("NO");
    }
    return 0;
}

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

using namespace std;

int main()
{
	int a; cin >> a;
	int t[3];

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

	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
using namespace std;
int main() {
  int A[3], N;
  for (int Q = 0; Q < N; Q++) {
    rep(i, 3) cin >> A[i];
    sort(A, A + 3);
    if (A[0] * A[0] + A[1] * A[1] - A[2] * A[2] == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <complex>
#include <ctime>
#include <cassert>
#include <functional>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> PII;

#define REP(i,s,t) for(int i=(s);i<(t);i++)
#define FILL(x,v) memset(x,v,sizeof(x))

using namespace std;
string is_valid_triangle(int a, int b, int c){
    string out = "NO";
    if (pow(a, 2) == pow(b,2) + pow(c,2) || pow(b, 2) == pow(a, 2) + pow(c, 2) || pow(c, 2) == pow(a, 2) + pow(b, 2)){
        out = "YES";
    }
    return out;
}
int main() {
    int l;
    cin >> l;
    REP(i, 0, l){
        int a, b, c;
        cin >> a >> b >> c;
        cout << is_valid_triangle(a, b, c) << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<math.h>
#include<algorithm>
#include<string>
using namespace std;
int main(){
    int n,a[3],b[3],l,k;
    cin>>n;
    for(l=0;l<n;l++){
        if(n>1000||n<=0){
            break;
        }
        for(k=0;k<3;k++){
            cin>>a[k];
            if(a[k]>1000||a[k]<=0){
                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 <stdio.h>

void right_triangle (int x, int y, int z)
{
    if(x * x == y * y + z * z || y * y == z * z + x * x || z * z == x * x + y * y){
        printf("YES\n");
    } else {
        printf("NO\n");
    }
}

int main(void)
{
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i){
        int x, y, z;
        scanf("%d %d %d", &x, &y, &z);
        right_triangle(x, y, z);
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int main(){
        LL N;
        cin>>N;
        REP(i,N){
            vector<int>v;
            int a,b,c;
            cin>>a>>b>>c;
            v.push_back(a);
            v.push_back(b);
            v.push_back(c);
            sort(v.begin(),v.end());
            if(v[0]*v[0]+v[1]*v[1]==v[2]*v[2]){
               cout<<"YES"<<endl;
            }else{
               cout<<"NO"<<endl;
            }
        }
	return(0);
}

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

int main()
{
    int m,n,k,j,i,sum=0;
    while(cin>>j)
    {
       for(i=0;i<j;i++)
    {
    cin>>m>>n>>k;
    sum=sqrt((m*m)+(n*n));
    if(k==sum)
    {
        cout<<"YES"<<endl;
    }
    else
    cout<<"NO"<<endl;
    }

    }

return 0;
}

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