Go: package main

import "fmt"

func main() {
	var n int

	fmt.Scanf("%d", &n)

	var a, b, c int
	for i := 0; i < n; i++ {
		var isTriangle bool
		fmt.Scanf("%d %d %d", &a, &b, &c)

		if a*a == b*b+c*c || b*b == a*a+c*c || c*c == b*b+a*a {
			isTriangle = true
		}

		if isTriangle == true {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <iomanip>
#include <fstream>
#include <climits>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <deque>
#include <list>
#include <map>
#include <set>
using namespace std;

typedef long long LL;
typedef unsigned int ui;
typedef unsigned long long ULL;

typedef pair < int , int > ii;
typedef pair < LL  , LL  > ll;

typedef vector <int>  vint;
typedef vector <bool> vbool;
typedef vector <long> vlong;

#define sz(x)			((int)x.size())
#define tin(x)			scanf("%d",&x)
#define all(x)			x.begin(),x.end()
#define Set(b,a)		memset(b,a,sizeof b)
#define print1(x)		printf("Case %d:",x++)
#define tin2(x,y)		scanf("%d%d",&x,&y)
#define tin3(x,y,z)		scanf("%d%d%d",&x,&y,&z)
#define loop(i,i0,in)	for(int i=i0 ; i<in ; i++)
#define rep(i,n)		for(int i=0 ; i<(n) ; i++)
#define _rep(i,n)		for(int i=n-1 ; i>=0 ; i--)
#define _loop(i,in,i0)	for(int i=in-1 ; i>=i0 ; i--)
#define Fore(it, x)		for(typeof (x.begin()) it = x.begin(); it != x.end (); it++)

const int maxn = 5;

int seq[maxn];
     
int main()  
{  
#ifdef Online_Judge
	freopen("a.in","r",stdin);
#endif
	int t;
	tin(t);
	while(t--)
	{
		rep(i,3)
			tin(seq[i]);
		sort(seq,seq+3);
		if((seq[0]*seq[0])+(seq[1]*seq[1])==(seq[2]*seq[2]))
			puts("YES");
		else
			puts("NO");
	}
	return 0;
}

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

C++: #include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    bool right_triangle = false;
    if (a * a + b * b == c * c) right_triangle = true;
    else if (b * b + c * c == a * a) right_triangle = true;
    else if (a * a + c * c == b * b) right_triangle = true;
    if (right_triangle)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}

C++: #include<iostream>
using namespace std;
int main(){
	int n,z,y,x;
	cin>>n;
	while(n-->0){
		cin>>x>>y>>z;
		x*=x;
		y*=y;
		z*=z;
		if(x+y==z||x+z==y||y+z==x)
		cout<<"YES"<<endl;
		else
		cout<<"NO"<<endl;
	}
	return 0;
}

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


long long n,i,a[10];

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n;
	for(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"<<'\n';
		}else
			cout<<"NO"<<'\n';
	}
	
	
	
return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a[3];
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		cout << (hypot(a[0], a[1]) == a[2] ? "YES\n" : "NO\n");
	}
}

C++: #include <stdio.h>

int main (void)
{
	int n, i;
	int a, b, c;
	
	scanf("%d", &n);
	
	for (i=0; i<n; i++)
	{
		scanf("%d %d %d", &a, &b, &c);
		
		// find maximum
		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*c == b*b + a*a)
			{
				printf("YES\n");
			}else
			{
				printf("NO\n");
			}
		}
	}
}

C++: #include<iostream>

using namespace std;

int main(){

	int num,i,j;
	
	cout << "the number of data set: ";
	cin >> num;
	
	int a[num],b[num],c[num];
	
	for(i=0;i<num;i++){
		do{
			cin >> a[i] >> b[i] >> c[i];
		}while((a[i]<0||a[i]>1000)&&(b[i]<0||b[i]>1000)&&(c[i]<0||c[i]>1000));
	}
	
	int triangle[3];
	for(i=0;i<num;i++){
		triangle[0] = a[i];
		triangle[1] = b[i];
		triangle[2] = c[i];
		
		int max,max_num;
		max = triangle[0];
		max_num = 0;
		for(j=0;j<3;j++){
			if(max<triangle[j]){
				max = triangle[j];
				max_num = j;
			}
		}
		switch(max_num){
			case(0):if(a[i]*a[i] == b[i]*b[i] + c[i]*c[i]) cout << "YES\n";
					else cout << "NO\n";
					break;
			case(1):if(b[i]*b[i] == a[i]*a[i] + c[i]*c[i]) cout << "NO\n";
					else cout << "NO\n";
					break;
			case(2):if(c[i]*c[i] == a[i]*a[i] + b[i]*b[i]) cout << "YES\n";
					else cout << "NO\n";
					break;
			default:break;
		}
	}
	
	return 0;
}

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

bool judge(int, int, int);

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

bool judge(int a, int b, int c) {
	if (a * a == b * b + c * c || b * b == a * a + c * c || c * c == a * a + b * b) {
		return true;
	} else {
		return false;
	}
}

C++: #include<stdio.h>
/*複数のデータセットに対して、各々が直角三角形か
どうか判定する*/
void right_triangle(int x, int y, int z);

int main(void)
{
    int n;//nはデータセットの個数
    scanf("%d", &n);
    for ( int i = 0; i <n ; ++i){
        int a, b, c;//a,b,cは辺の長さ
        scanf("%d %d %d", &a, &b, &c);
        right_triangle(a , b, c);
    }
    return 0;
}    

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

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

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

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

using namespace std;

int main()
{
    int n;
    vector<int> side(3);

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

    return 0;
}

C++: #include <stdio.h>

void right_triangle(int a, int b, int c);

int main(void)
{
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
        int a, b, c;
        scanf("%d %d %d", &a, &b, &c);
        right_triangle(a, b, c);
    }
    return 0;
}

void right_triangle(int a, int b, int c)
{
    int x, y, z;
    if (a <= b) {
        if (b <= c) {
            x = a;
            y = b;
            z = c;
        } else {
            x = a;
            y = c;
            z = b;
        }
    } else {
        if (a <= c) {
            x = a;
            y = b;
            z = c;
        } else {
            x = b;
            y = c;
            z = a;
        }
    }
    //ここまででzに最大値を持ってきた
    if (x * x + y * y == z * z) {
    printf("YES\n");
    } else {
    printf("NO\n");
    }
}

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

int N ;
int a,b,c,x,y,z ;

int main()
{
	cin >> N ;

	while( N > 0 )
	{
		cin >> a >> b >> c ;

		x = max( a, max( b, c ) ) ;
		y = min( a, max( b, c ) ) ;
		z = min( a, min( b, c ) ) ;

		if( ((x*x) == ((y*y) + (z*z))) || ((y*y) == ((x*x) + (z*z))) || ((z*z) == ((x*x) + (y*y))) )
		{
			cout << "YES" << endl ;
		}
		else
		{
			cout << "NO" << endl ;
		}

		N -- ;
	}

	return 0 ;
}