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++: /*
AOJ_0003_IsitaRightTriangle?

EOFはWindowsはCtrl+Z,UNIXはCtrl+D

方針
配列入れて昇順ソートして　１番目と２番目の二乗の合計が
三番目の二乗になってるか確かめる。

配列の大きさが３固定なので、multisetに格納するのはもったいない
普通の配列に入れて、sortを使う

*/

#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>
#include <string.h>

typedef struct{
    int m[3];
}triangle;

int main( void ){

    triangle *tri;
    int e;
    scanf( "%d",&e );
    if(( tri = ( triangle * ) malloc( sizeof( triangle ) * e )) == NULL ) return -1;
    for( int i = 0;i < e;i++ )scanf( "%d %d %d",
                                        &tri[i].m[0],&tri[i].m[1],&tri[i].m[2] );

    for( int i = 0;i < e;i++ ){
        for( int k = 0;k < 2;k++ ){
            for( int j = 0;j < 2;j++ ){
                if( tri[i].m[j] => tri[i].m[j+1] ){
                    int buf = tri[i].m[j];
                    tri[i].m[j] = tri[i].m[j+1];
                    tri[i].m[j+1] = buf;
                }
            }
        }
        if( tri[i].m[0] * tri[i].m[0] + tri[i].m[1] * tri[i].m[1] == tri[i].m[2] * tri[i].m[2] ) printf( "YES\n" );   
        else printf( "NO\n" );
    }
    return 0;
}

C++: #include <iostream>

using namespace std;
int loop;
int panjang[1000][1000];
int y = 0;
int temp = 0;
int main()
{
 cin >> loop;
for(int x=0;x<loop;x++)
{
        cin >> panjang[x][y] >> panjang[x][y+1] >> panjang[x][y+2];

}
for(int looper= 0;looper<loop;looper++)
{
    for(int looper2 = 0;looper2<4;looper2++)
{
    if((panjang[looper][y+1])<(panjang[looper][y+2]))
    {
        temp = panjang[looper][y+1];
        panjang[looper][y+1]=panjang[looper][y+2];
        panjang[looper][y+2]=temp;
        temp = 0;
            if((panjang[looper][y])<(panjang[looper][y+1]))
    {
        temp = panjang[looper][y];
        panjang[looper][y]=panjang[looper][y+1];
        panjang[looper][y+1]=temp;
        temp = 0;
    }
    }

}

for(int pyth=0;pyth<loop;pyth++)
{
    if(panjang[pyth][y]*panjang[pyth][y]==panjang[pyth][y+1]*panjang[pyth][y+1]+panjang[pyth][y+2]*panjang[pyth][y+2])
        cout << "YES" << endl;
    else cout << "NO" << endl;
}


}

}

C++: #include<stdio.h>

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

int main(void)
{
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        int r[3];
        scanf("%d %d %d", &r[0], &r[1], &r[2]);
        right_triangle(r[0], r[1], r[2]);
    }
    return 0;
}

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

#define Triangle(s1,s2,s3) if(s1*s1+s2*s2==s3*s3)
using namespace std;

int main()
{
	int n;
	int h[3];
	vector<int> side;
	int i;
	
	cin >> n;
	
	for(i=0;i<n;i++)
	{
		side.clear();
		
		for(int j=0;j<3;j++)
		{
			cin >> h[j];
			side.push_back(h[j]);
		}
		
		sort(side.begin(),side.end());
		
		Triangle(side[0],side[1],side[2])
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}

C++: #include <stdio.h>

bool check(int n1, int n2 , int n3){
	int a,b;
	a = n1*n1;
	b = n2*n2 + n3*n3;
	return (a==b)? true : false ;
}

int main(){
	int N,n1,n2,n3;

	scanf("%d", &N);
	for(int i=0 ; i<N ; i++){
		scanf("%d %d %d", &n1 , &n2 , &n3);
		if( check(n1,n2,n3) || check(n2,n1,n3) || check(n3,n2,n1) ){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}

	return 0;
}

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

C++: #include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <sstream>

using namespace std;

int main (void)
{
	int n,a[3];

	cin >> n;

	for (int j = 0; j < n; j++)
	{
		for (int i = 0; i < 3; i++)
		{
			cin >> a[i];
		}

		sort (a,a + 3);

		if ((a[0] * a[0]) + (a[1] * a[1]) == (a[2] * a[2]))
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
		a[0] = 0;
		a[1] = 0;
		a[2] = 0;
	}
}

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

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

int main(void) {
    int n;
    vector<int> tri(3,0);
    cin >> n;
    for(int i=0; i<n; i++) {
        cin >> tri[0] >> tri[1] >> tri[2];
        sort(tri.begin(),tri.end(),greater<int>());
        if(tri[0]*tri[0] == tri[1]*tri[1] + tri[2]*tri[2]) {
            cout << "YES" << endl;
        }
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include <cstdio>

int main(){
	int N;
	scanf("%d", &N);
	for(int i = 0; i < N; i++){
		int a, b, c;
		scanf("%d %d %d\n", &a, &b, &c);
		puts(((a *a + b*b == c*c) || (a*a + c*c == b*b) || (b*b + c*c == a*a))?"YES":"NO");
	}
	return 0;
}

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

using namespace std;

double check_right_triangle(int a,int b,int c){
    return (pow(a,2) + pow(b,2) - pow(c,2))/(2 * a * b);
}

int main(void){
    int n,a,b,c;
    cin >> n;
    for(int i=0;i < n;i ++){
        cin >> a >> b >> c;
        if((check_right_triangle(a,b,c) *
            check_right_triangle(a,c,b) *
            check_right_triangle(b,c,a)) == 0){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}

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

int main(){
  int n;
  cin >> n;
  for(int i = 0;i<n;i++){
    int a, b, c;
    cin >> a >> b >> c;
    if(max({a,b,c}) == a && b * b + c * c == a * a){
      cout << "YES" << endl;
    }else if(max({a,b,c}) == b && a * a + c * c == b * b){
      cout << "YES" << endl;
    }else if(max({a,b,c}) == c && a * a + b * b == c * c){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
  return 0;
}