Go: package main

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

func main() {
	n, _ := strconv.Atoi(strScan())
	scanner := bufio.NewScanner(os.Stdin)
	for i := 0; i < n; i++ {
		scanner.Scan()
		strArr := strings.Fields(scanner.Text())
		castNumArr := StringToInt(strArr)
		fmt.Println(checkTriangle(castNumArr))
	}
}

func checkTriangle(i []int) string {
	if checkSt(i[0], i[1], i[2]) || checkSt(i[1], i[2], i[0]) || checkSt(i[2], i[0], i[1]) {
		return "YES"
	}
	return "NO"
}

func Sq(x int) int {
	return x * x
}

func checkSt(a, b, c int) bool {
	return (Sq(a) + Sq(b)) == Sq(c)
}

func StringToInt(s []string) []int {
	var i []int
	for _, v := range s {
		castNum, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		i = append(i, castNum)
	}
	return i
}

func strScan() (stringInput string) {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	stringInput = scanner.Text()
	return
}

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

using namespace std;

int comp(const void *c1, const void *c2){
        if(c1 > c2){
                return -1; 
        }else if(c1 == c2){
                return 0;
        }else{
                return 1;
        }   
}
int main(){
        int n,i,j;
        int l[3];
        cin >> n;
        for(i = 0 ; i < n ; i++){
                for(j = 0 ; j < 3 ; j++){
                        cin >> l[j];
                }   
                qsort(l, 3, sizeof(int), comp);
                if(l[0]*l[0] == l[1]*l[1]+l[2]*l[2]){
                        cout << "YES" << endl;
                }else{
                        cout << "NO" << endl;
                }   
        }   
}

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;
			return;
		}
		else if (a * a + c * c == b * b)
		{
			cout << "YES" << endl;
			return;
		}
		else if (c * c + b * b == a * a)
		{
			cout << "YES" << endl;
			return;
		}
		else
		{
			cout << "NO" << endl;
			return;
		}
	}
	return 0;
}

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

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };


int main() {
	int n, d[3];
	scanf( "%d", &n );
	while ( n-- ) {
		for ( int i = 0; i < 3; i++ ) {
			scanf( "%d", &d[ i ] );
		}
		sort( d, d + 3 );
		printf( "%s\n", sq( d[ 0 ] ) + sq( d[ 1 ] ) == sq( d[ 2 ] ) ? "YES" : "NO" );
	}
	return 0;
}

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

using namespace std;


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

	int a[3];
	int i,j;

	for(j=0 ; j<N ; j++){

		for(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])){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}

	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int n;
  cin>>n;
  int a[n][3];
  for(int j=0;j<n;j++){
    for(int i=0;i<3;i++){
      cin>>a[j][i];
      if(a[j][i]>a[j][0]){
	int b=a[j][0];
	a[j][0]=a[j][i];
      a[j][i]=b;
      }
    }
  }
  for(int i=0;i<n;i++){
    if(a[i][0]*a[i][0]==a[i][1]*a[i][1]+a[i][2]*a[i][2]){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return(0);
}

C++: #include <iostream>
#include <cstdlib>
#include <stdio.h>
#include <cmath>

using namespace std;


int main(){
    int a, b, c;
    char* str;
    str = (char*)malloc(sizeof(char) * 50);

    if(fgets(str, 50, stdin) == NULL) return 0; // 読み捨て

    while(fgets(str, 50, stdin) != NULL) {
        if(!strcmp("", str)) break;

        sscanf(str, "%d%d%d", &a, &b, &c);
        a = pow(a, 2);
        b = pow(b, 2);
        c = pow(c, 2);

        cout << ((a + b == c || b + c == a || b + c == a) ? "YES" : "NO") << endl;
    }

    return 0;
}

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

C++: #include<stdio.h>
int main(void)
{
	int n,i,w,a,s,d,x,j,z;
		scanf("%\n",&n);
		for(i=0;i<n;i++){
			scanf("%d %d %d",&a,&s,&d);
			if(a>s&&d<a){
				w=(d*d)+(s*s);
				x=a*a;
					if(w==x){
						printf("YES\n");
					}
					else{
						printf("NO\n");
					}	
			}	
			if(a<d&&d>s){
				w=(a*a)+(s*s);
				x=d*d;
					if(w==x){
						printf("YES\n");
					}
					else{
						printf("NO\n");
					}				
			}
			if(a<s&&s>d){
				w=(d*d)+(s*s);
				x=s*s;
					if(w==x){
						printf("YES\n");
					}
					else{
						printf("NO\n");
					}				
			}
			if(a==s&&s==d){
				printf("NO\n");
			}	
		
		}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int x,y,z,n=0,v,m;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>x>>y>>z;
		for(int e=0;e<3;e++){
			if(z<y){
				v=y;
				m=z;
				z=v;
				y=m;
			}else if(z<x){
				v=x;
				m=z;
				z=v;
				x=m;
			}
		}
	 if(z*z==y*y+x*x){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
return 0;
}

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

using namespace std;

int main() {
    size_t N;
    scanf("%zu", &N);

    for (size_t i=0; i<N; ++i) {
        vector<int> a(3);
        for (size_t i=0; i<3; ++i)
            scanf("%d", &a[i]);

        sort(a.begin(), a.end());
        printf("%s\n", (a[0]*a[0]+a[1]*a[1]==a[2]*a[2])? "YES":"NO");
    }

    return 0;
}

C++: #include<iostream>

int main(){
	int a,b,c;
	std::cin>>a>>b>>c
	if(a*a+b*b==c*c){
		std::cout<<"YES";
	}else if(a*a+c*c==b*b){
		std::cout<<"YES";
	}else if(b*b+c*c==a*a){
		std::cout<<"YES";
	}else{
		std::cout<<"NO";	
}
	return 0;
}