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<math.h>
#include<algorithm>
using namespace std;
int main(){
    int n,a[1000],b,c,i[3],f[3],j,max,l,k,gou=0,gou2;
    float opi=4;
    cin>>n;
    for(l=0;l<n;l++){
        for(k=0;k<3;k++){
            cin>>i[k];
            if(i[k]>=1000||i[k]<=0){
                break;
            }
            f[k]=i[k]^2;
        }
        sort(f,f+3);
        if(f[2]==f[0]+f[1]){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
  
using namespace std;
  
int main(void){
  int n,array[3],i;
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d %d %d",&array[0],&array[1],&array[2]);
    sort(array,array+3);
    if(array[0]*array[0]+array[1]*array[1]==array[2]*array[2])  printf("YES\n");
    else  printf("NO\n");
  }
  
  return 0;
}

C++: //	??´?§?????§???¢ 
#include<iostream>
using namespace std;

int abs(int t) {
	if (t < 0) {
		t = t * -1;
	}
	return t;
}
int main() {
	int a,b,c;
	cin >> a >> b >> c;
	if (a + b > c && a + c > b && b + c > a){
		if ( ((a*a + b*b) == c*c) ||  ((a*a + c*c) == b*b) || ((b*b + c*c) == a*a) ){
			cout << "yes" << endl;
			return 0;
		}
	}
	cout << "no" << endl;
}

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

int main(){
	int n;
	std::cin>>n;
	for(int i=0;i<n;i++){
		std::vector<int>v(3,0);		
		for(int j=0;j<3;j++)std::cin>>v[j];
		for(int j=0;j<3;j++){
			for(int k=0;k<2;k++){
				if(v[k]<v[k+1]){
					v[k]^=v[k+1];
					v[k+1]^=v[k];
					v[k]^=v[k+1];
				}
			}
		}
		if(v[0]*v[0]==v[1]*v[1]+v[2]*v[2])std::cout<<"YES"<<std::endl;
		else std::cout<<"NO"<<std::endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int a, b, c, buf;
  int n;
  bool x[1000];
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a >> b >> c;
    if(c > b){
      buf = c;
      c = b;
      b = buf;
    }
    if(b > a){
      buf = b;
      b = a;
      a = buf;
    }
    if(a*a==b*b+c*c)
      x[i] = 1;
    else
      x[i] = 0;
  }
  for(int i = 0; i < n; i++){
    if(x[i] == 0)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  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^2;
		b2 = b^2;
		c2 = c^2;

		if(a==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 <iostream>
#include <algorithm>
using namespace std;

bool isRTri(int a, int b, int c)
{
    return a * a + b * b == c * c;
}

int main()
{
    int n;
    cin >> n;
    for (int k = 1; k <= n; k++)
    {
        int a[3];
        cin >> a[0] >> a[1] >> a[2];
        sort(a, a + 3);
        bool r = isRTri(a[0], a[1], a[2]);
        cout << (r ? "YES" : "NO") << endl;
    }
    return 0;
}

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

namespace
{
	auto is_right = [](std::vector<unsigned int> length)
	{
		std::sort(length.begin(), length.end());
		std::transform(length.begin(), length.end(), length.begin(),
			[](unsigned int element) { return std::pow(element, 2); });
		return length[0] + length[1] == length[2];
	};
}

namespace
{
	unsigned int N; std::vector<unsigned int> length(3);
}

int main()
{
	std::scanf("%u", &N);
	for (unsigned int i = 0; i < N; i++)
	{
		std::scanf("%u%u%u", &length[0], &length[1], &length[2]);
		std::printf((is_right(length) ? "YES\n" : "NO\n"));
	}
	return 0;
}

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

C++: #include <iostream>
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <cmath>
#include<algorithm>
using namespace std;
int main()
{
    int a,b,c,n,i;
    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 <iostream>
#include <stdlib.h>
using namespace std;
int cmp(const void *a,const void *b)
{
	return *(int*)a-*(int*)b;
}
int main()
{
	int N,i,a[3];
	cin>>N;
	for (i=0;i<N;i++)
	{
			cin>>a[0]>>a[1]>>a[2];
			qsort(a,3,sizeof(int),cmp);
			if (a[0]*a[0]+a[1]*a[1]==a[2]*a[2])
				//d[i]=1;
				cout<<"YES"<<endl;
			else
				cout<<"NO"<<endl;
				//d[i]=0;
			//i++;
	}
	return 0;
}

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

bool flag_rightangle(int a, int b, int c)//三辺a,b,cを持つ三角形が直角三角形かどうか
{
    if ((a * a == b * b + c * c) || (b * b == c * c + a * a) || (c * c == a * a + b * b)){
        return true;
    } else {
        return false;
    }
}

int main(void){
    int line_number;
    scanf("%d", &line_number);
    for(int i = 0; i < line_number; i++){
        int first_number;
        int second_number;
        int third_number;
        scanf("%d %d %d", &first_number, &second_number, &third_number);
        if (flag_rightangle(first_number, second_number, third_number) == true){
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }
    return 0;
}

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

int main(void) {
    int length[3];
    int n;
    int A, B, C;
    
    cin >> n;
    
    for(int i = 0; i < n; ++i) {
        cin >> length[0] >> length[1] >> length[2];
        sort(length, length + 3);
        A = length[0] * length[0];
        B = length[1] * length[1];
        C = length[2] * length[2];
        if(A + B == C || B + C == A || C + A == B) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
}

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

using namespace std;

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(m,a[2]);
		
		if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2])puts("YES");
		else{
			if(m<30)puts("NO");
			else puts("YES");
		}
	}
}