Go: // 九九を出すだけ
package main
import (
	"fmt"
	"os"
	"bufio"
	"strconv"
	"sort"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main(){
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	n := nextInt()
	for i:=0; i<n; i++{
	    data := nextInts(3)
	    sort.Ints(data)
	    if data[0]*data[0]+data[1]*data[1] == data[2]*data[2]{
	        fmt.Fprintln(out, "YES")
	    }else{
	        fmt.Fprintln(out, "NO")
	    }
	}
}

func next() string{
	sc.Scan()
	return sc.Text()
}

func nextInt() int{
	a, _ := strconv.Atoi(next())
	return a
}

func nextInts(n int) []int{
    a := make([]int, n)
    for i:=0; i<n; i++{
        a[i] = nextInt()
    }
    return a
}

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";
        }
    }
}

C++: #include<iostream>

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

	return 0;
}

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

using namespace std;

int main(void){
	int n, i;
	double a, b, c;
	scanf("%d",&n);
	for(i = 0;i < n;i++){
		scanf("%lf%lf%lf",&a,&b,&c);
		if(pow(a,2.0) + pow(b,2.0) == pow(c,2.0) || pow(b,2.0) + pow(c,2.0) == pow(a,2.0) || pow(c,2.0) + pow(a,2.0) == pow(b,2.0)){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}