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 <functional>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
	int iMax;
	cin >> iMax;
	for (int i = 0; i < iMax; ++i){
		vector<int> x;
		int t;
		for (int j = 0; j < 3; ++j){
			cin >> t;
			x.push_back(t);
		}
		sort(x.begin(), x.end());
		if (pow(x[0], 2)+pow(x[1], 2) == pow(x[2], 2)){
			cout << "YES" << endl;
		} else{
			cout << "NO" << endl;
		}
	}
	
	return 0;
}

C++: #include <cstdio>

using namespace std;

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

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

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

using namespace std;

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


	return 0;
}

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

int main()
{
	int iCount, ia, ib, ic;
	int iTrueFlag[1000];

	cin >> iCount;

	for( int i=0;i<iCount;i++ ){
		cin >> ia >> ib >> ic;

		if( (ia * ia) + (ib * ib) == (ic * ic) )
			iTrueFlag[i] = 1;
		else
			iTrueFlag[i] = 0;
	}

	for( int i=0;i<iCount;i++ ){
		if( iTrueFlag[i] == 1 )
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

C++: #include <iostream>

void checkTringle(int a,int b,int c){
    if(a^2==b^2+c^2){
        std::cout << "YES" << std::endl;
    }else{
        std::cout << "NO" << std::endl;
    }
}

int main(int argc, char *argv[])
{
    int dataSize;
    std::cin >> dataSize;

    for(int i = 0; i < dataSize; i++){
        int a,b,c;
        std::cin >> a >> b >> c;

        if(a>b){
            if(a>c){
                checkTringle(a,b,c);
            }else{
                checkTringle(c,a,b);
            }
        }else{
            if(b>c){
                checkTringle(b,c,a);
            }else{
                checkTringle(c,a,b);
            }
        }
    }
}

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 n,a[3];
	scanf("%d",&n);
	int i,j,k;
	for(k=0;k<n;k++){
		scanf("%d %d %d",&a[0],&a[1],&a[2]);
		for(i=0;i<3;i++){
			a[i]=a[i]*a[i];
		}
		j=0;
		for(i=0;i<3;i++){
			if((j=0)||(a[i%3]-a[(i+1)%3]-a[(i+2)%3]==0)){
				j=1;
			}
		}
		if(j==1){
			printf("YES\n");
		}else{
			printf("NO\n");
		}

	}
	return 0;
}

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

int main()
{
	using namespace std;
	int n;
	cin >> n;

	for (int i = 0; i < n; i++)
	{
		auto square = [](unsigned x) {return x * x; };

		vector<unsigned> sides(3, 0);
		cin >> sides[0] >> sides[1] >> sides[2];
		sort(sides.begin(), sides.end());


		if (square(sides[0]) + square(sides[1]) == square(sides[2]))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}

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

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

using namespace std;

int main(){
    int a, b, c, phase, phaseMax;
    phase = 1;

    cin >> phaseMax;
    while(cin >> a >> b >> c) {
        a = pow(a, 2);
        b = pow(b, 2);
        c = pow(c, 2);

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

        if(phase++ >= phaseMax) break;
    }

    return 0;
}

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

#define REP( i, n )	for( int (i) = 0; (i) < (n); (i)++ )
#define ALL( x )	(x).begin(), (x).end()

bool isRightAngle( int a, int b, int c );

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

	REP( i, n ) {
		int a, b, c; cin >> a >> b >> c;

		if( isRightAngle( a, b, c ) == true ) cout << "YES" <<endl;
		else								  cout << "NO" << endl;
	}

}

bool isRightAngle( int a, int b, int c ) {
	if( a > b && a > c ) {
		if( a * a == b * b + c * c ) return true;
		else						 return false;
	}
	if( b > a && b > c ) {
		if( b * b == a * a + c * c ) return true;
		else						 return false;
	}
	if( c > a && c > a ) {
		if( c * c == a * a + b * b ) return true;
		else						 return false;
	}
	return false;
}

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 <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

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

C++: #include <iostream>

using namespace std;

int main(){
    while(1){
        int N;
        cin>>N;
        if(cin.eof())return 0;

        while(N--){
            int x,y,z;
            cin>>x>>y>>z;
            if((x*x+y*y)==(z*z)||(x*x+z*z)==(y*y)||(y*y+z*z)==(x*x))cout<<"YES\n";
            else cout<<"NO\n";
        }
    }
}