Go: package main

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

func main() {
	n, err := strconv.Atoi(strScan())
	if err != nil {
		fmt.Println("数字を入力して下さい。")
	} else {
		var counter int = n
		var judgeArr []string
		scanner := bufio.NewScanner(os.Stdin)
		for scanner.Scan() {
			strArr := strings.Fields(scanner.Text())
			castNumArr := StringToInt(strArr)
			judgeArr = append(judgeArr, checkTriangle(castNumArr))
			counter--
			if counter == 0 {
				break
			}
		}
		for _, v := range judgeArr {
			fmt.Println(v)
		}
	}
}

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)
}

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>

using namespace std;

int main(){
	int a,b,c,d;
	cin>>a;
	for(int i=1;i<=a;i++){
		cin>>b>>c>>d;
		if(b*b+c*c==d*d || c*c+d*d==b*b || b*b+d*d==c*c){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	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||i[a]>1000){
                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 <iostream>
#include <cmath>

using namespace std;

int main() {
    int i,j,n,a,b,c;

    cin >> n;

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

        if(a == sqrt(pow(b,2) + pow(c,2))){
            cout << "Yes" << endl;
        }

        else if(b == sqrt(pow(a,2) + pow(c,2))){
            cout << "Yes" << endl;
        }

        else if(c == sqrt(pow(a,2) + pow(b,2))){
            cout << "Yes" << endl;
        }

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

    return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int x,y,n, i, j,a[1000],b[1000],c[1000];
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> a[i] >> b[i] >> c[i];
	}
	for (j = 0; j < n; j++) {
		x = a[j] * a[j] + b[j] * b[j];
		y = c[j] * c[j];
		if (x == y) {
			cout << "Yes"<<endl;
		}
		else {
			cout << "No" << endl;
		}
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n=0;
	int i=0;
	int a[1001]={0},b[1001]={0},c[1001]={0};
	int irekae=0;
	int irekae2=0;

	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		scanf("%d",&b[i]);
		if (a[i]>b[i])
		{
			irekae=a[i];
			a[i]=b[i];
			b[i]=irekae;
		}
		scanf("%d",&c[i]);
		if (a[i]>c[i])
		{
			irekae=a[i];
			irekae2=b[i];
			a[i]=c[i];
			b[i]=irekae;
			c[i]=irekae2;
		}
		if (c[i]*c[i]==a[i]*a[i]+b[i]*b[i])
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}


	return 0;
}

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

#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

int main(void){
    
    int number;
    int hen[3];
    int temp;
    cin >> number;
    char *judge[200];
    
    REP(i,number)
    {
        REP(i, 3)
        cin >> hen[i];
        REP(i, 2)
        REP(j, 2)
        {
            if(hen[j] < hen[j+1])
            {
                temp = hen[j+1];
                hen[j+1] = hen[j];
                hen[j] = temp;
            }
        }
        if(hen[0]*hen[0] == (hen[1]*hen[1] + hen[2]*hen[2]))
            judge[i] = "YES";
        else
            judge[i] = "NO";
        
    }
    REP(i, number)
    cout << judge[i] << endl;
    
    return 0;
}

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

int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int n;
    std::cin >> n;
    for(int i=0; i<n; ++i){
        std::vector<int> e(3);
        for(auto& j : e){
            std::cin >> j;
        }
        std::sort(e.begin(), e.end());
        std::cout << ((e[0]*e[0]+e[1]*e[1]==e[2]*e[2])?"YES":"NO") << "\n";
    }
    return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int N;
double a, b, c;

void rep(double* x,double* y){
	double d;
	d = *x;
	*x = *y;
	*y = d;
}

int main(){
	
	cin >> N;
	for(int i = 0; i < N; ++i){
		cin >> a >> b >> c;
		
		if(a < b || a < c){
			if(b < c){
				rep(&a, &c);
			}else{
				rep(&a, &b);
			}
		}

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


	}
	return 0;
}

C++: #include <stdio.h>
#include <math.h>	/* ???????????????!! */



int main()
{
    int inputLineSize;
	int i;
	int input_X;
	int input_Y;
	int input_Z;
	int x[1000];
	int y[1000];
	int z[1000];

	scanf("%d", &inputLineSize);
	if(inputLineSize>1000) {
		return 0;
	}
	for(i=0; i < inputLineSize; i++) {
		scanf("%d%d%d", &input_X,&input_Y,&input_Z);
		x[i] = input_X;
		y[i] = input_Y;
		z[i] = input_Z;
	}
	
	for(i=0; i < inputLineSize; i++) {
		if( x[i] > 0 && y[i] > 0 && z[i] > 0) {
			if(pow(x[i],2) + pow(y[i],2) == pow(z[i],2) ) {
        		printf("YES\n");
			} else {
        		printf("NO\n");
			}
		} else {
        	printf("NO\n");
		}
	}

    return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>

using namespace std;

int convertToInt(const string& str){
    stringstream ss;
    ss << str;

    int ret;
    ss >> ret;

    return ret;
}

void convertToIntVec(const string& str, vector<int>& ret){
    stringstream ss;
    ss << str;

    int a, b, c;
    ss >> a >> b >> c;

    ret.resize(3);
    ret[0] = a; ret[1] = b; ret[2] = c;
}



void readData(vector<string>& input_data){
    string buff;
    getline(cin, buff);

    int lines = convertToInt(buff);

    for(int i = 0; i < lines; ++i){
        getline(cin, buff);
        input_data.push_back(buff);
    }
}

bool isRightTriangle(vector<int>& edge){
    sort(edge.begin(), edge.end(), [](int a, int b)->bool{ return a < b; });
    return (edge[0]*edge[0] + edge[1] * edge[1] == edge[2] * edge[2]);
}


void mainRoutine(){
    vector<string> input_data;

    readData(input_data);

    for(int i = 0; i < input_data.size(); ++i){
        vector<int> edge;
        convertToIntVec(input_data[i], edge);
        cout << (isRightTriangle(edge) ? "YES" : "NO") << endl;
    }
}


int main(){
    mainRoutine();

    return 0;
}

C++: #include <iostream>
bool isRight(int a, int b, int c)
{
    //?????§???c??????????????????????????´???
    if (a > c) {
        std::swap(a, c);
    }
    if (b > c){
        std::swap(b, c);
    }
    
    return a * a + b * b == c * c;
}

int main()
{
    int N;
    int a, b, c;
    std::cin >> N;
    for (int i = 0; i < N; i++) {
        std::cin >> a >> b >> c;
        if (isRight(a, b, c)) {
            std::cout << "YES" << std::endl;
        } else {
            std::cout << "NO" << std::endl;
        }
    }
}

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

int N;
int a[3]; 

int main() {
  for (int i = 0; i < N; ++i) {
    scanf("%d %d %d",a[1],a[2],a[3]);
    sort(a,a+3);
    if (a[1]*a[1] + a[2]*a[2] = a[3]*a[3]) {
      printf("%s\n" , YES);
    } else {
      printf("%s\n" , NO);
    }
  }
  
}