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"
	} else {
		return "NO"
	}
}

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

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

C++: #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
  int n;
  while(cin >> n) {
    vector<string> ans;
    for (int i = 0; i < n; ++i) {
      int x, y, z;
      cin >> x >> y >> z;
      if (x < y + z && y < z + x && z < x + y) {
        if (x * x == y * y + z * z || y * y == z * z + x * x || z * z == x * x + y * y) {
          ans.push_back("YES");
        }
      } else {
        ans.push_back("NO");
      }
    }
    for (int i = 0; i < n; ++i) {
      cout << ans[i] << endl;
    }
  }
  return 0;
}

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

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

C++: #include <stdio.h>

int right(int x, int y, int z);

int main(void)
{
    int n, x, y, z;
    scanf("%d", &n);
    for (int i = 0; i < n; i ++) {
	scanf("%d %d %d", &x, &y, &z);
	if (right(x, y, z) == 1) {
	    printf("YES\n");
	} else {
	    printf("NO\n");
	    break;
	}
    }
    return 0;
}

int right(int x, int y, int z)
{
    if (x * x == y * y + z * z) {
	return 1;
    } else if (y * y ==  x * x + z * z) {
	return 1;
    } else if (z * z == x * x + y * y) {
	return 1;
    } else {
	return 0;
    }
}

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

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

    string Answer [1000];

    for (int x = 0; x <  TestCase ; x++)
        {
            int a;
            int b;
            int c;

            cin >> a >> b >> c;

            if (a*a + b*b == c*c)
            {
                Answer [x] = "YES";
            }
            else
            {
                Answer [x] = "NO";
            }
        }
    for (int y = 0; y < TestCase; y++)
    {
        cout << Answer [y] << endl;
    }


    return 0;
}

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

int main()
{

    int a, b, c;
    int num = 0;

    cin >> num;

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

        if( a >= b && a >= c )
        {
            if(a*a == b*b + c*c)
            {
                cout << "YES" << endl;
            }
            else
            {
                cout << "NO" << endl;
            }
        }

        else if( b >= c )
        {
            if(b*b == a*a + c*c)
            {
                cout << "YES" << endl;
            }
                        
            else
            {
                cout << "NO" << endl;
            }
        }

        else
        {
            if(c*c == a*a + b*b)
            {
                cout << "YES" << endl;
            }
                        
            else
            {
                cout << "NO" << endl;
            }
        }

    }   


    return 0;
}

C++: 
#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<stdio.h>
int main(){
  
  int dataset;
  int a,b,c;
  int i;
  
  scanf("%d",&dataset);
  
  for(i=0;i<dataset;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++: //
//  main.cpp
//  b
//
//  Created by h3037178 on 2017/07/31.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

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

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

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

#define DEBUG

#ifndef DEBUG 
#define fprintf (void)
#endif 

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

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int n,i;
	long a[3];

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

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

void swap(int &a,int &b){
    int  t=a;
    a=b;
    b=t;
}

void sort(int &a,int &b,int &c){
    if(a < b) swap(a,b);
    if(b < c) swap(b,c);
    if(a < b) swap(a,b);
}

int main(){
    int a[1000],b[1000],c[1000];
    int num;
    int i=0;
    do{
        cin >> num;
    }while(num > 1000);
    while(i < num){
        cin >> a[i] >> b[i] >>c[i];
        if(a[i] >= 1 && a[i] <= 1000)
             if(b[i] >= 1 && b[i] <= 1000)
                 if(c[i] >= 1 && c[i] <= 1000){
                    sort(a[i],b[i],c[i]);
                    i++;
                }
    }
    for(int i=0;i<num;i++){
        if(pow(a[i],2) == (pow(b[i],2) + pow(c[i],2)))
            cout << "YES"<<endl;
        else 
            cout << "NO"<<endl;
    }
    return 0;
}

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

int main()
{
	priority_queue<int> que;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		int a, b, c;
		for (int j = 0; j < 3; j++)
		{
			cin >> a;
			que.push(a);
		}
		a = que.top();
		que.pop();
		b = que.top();
		que.pop();
		c = que.top();
		que.pop();
		if (a*a==b*b+c*c)
			cout << "YES";
		else
			cout << "NO";
	}
	return 0;
}