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 <iostream>
using namespace std;
int f(int x){
    return x * x;
}

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

C++: #include<stdio.h>

int main()
{
    int a,b,c,i,n;
    scanf("%i",&n);
    for(i=1;i<=n;i++){
        scanf("%i%i%i",&a,&b,&c);
        if(c*c==a*a+b*b){
            printf("YES\n");
        }
        else{
            printf("NO\n");
        }
    }
    return 0;
}

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



int main(void){

	//??´?§?????§???¢??§????????????????????¶???a^2+b^2=c^2
	int N, a, b, c,L,M,S;

	cin >> N;

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

	
	}
	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-30;
const double INF = 1e12;

long double to_deg(long double r) {
    return r * 180.0 / (atan(1.0) * 4.0);
}
int main(){
	int a,b,c,T;
	cin>>T;
	REP(i,T){
		int a[3];
		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<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 <algorithm>

int main()
{
    int num;
    std::cin >> num; 
    int edge[3];

    for(int i = 0; i < num; i++) {

        std::cin >> edge[0] >> edge[1] >> edge[2];

        // "edge" to "edge+3" ha "array edge" no memory jyou no
        // adress no hajimari to owari wo simesu. 
        // Yoku miru to kou natteru ==> [hajimari, owari)
        std::sort(edge, edge + 3);

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

    }
}

C++: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSharpPractice
{
	class Program
	{
		static bool IsRightTriangle(int a, int b, int c)
		{
			return a * a + b * b == c * c;
		}
		static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());
			for (int j = 0; j < n; j++)
			{
				List<int> list = new List<int>();
				foreach (string val in Console.ReadLine().Split(' '))
				{
					list.Add(int.Parse(val));
				}
				bool flg = false;
				for (int i = 0; i < 3; i++)
				{
					flg |= IsRightTriangle(list[i], list[(i + 1) % 3], list[(i + 2) % 3]);
				}
				Console.WriteLine(flg ? "YES" : "NO");
			}
		}
	}
}

C++: #include <iostream>                                             
#include <cmath>                                                
#include <queue>                                                
using namespace std;                                            
                                                                
int main() {                                                    
  int N;                                                        
  cin >> N;                                                     
  priority_queue<int> data;                                     
  while (N--) {                                                 
    int a, b, c;                                                
    cin >> a >> b >> c;                                         
    data.push(a);                                               
    data.push(b);                                               
    data.push(c);                                               
    a = data.top();                                             
    data.pop();                                                 
    b = data.top();                                             
    data.pop();                                                 
    c = data.top();                                             
    data.pop();                                                 
    if (pow(a,2)==pow(b,2)+pow(c,2)) {                          
      cout << "YES" << endl;                                    
    } else {                                                    
      cout << "NO" << endl;                                     
    }                                                           
  }                                                             
  return 0;                                                     
}

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

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

C++: #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
    int n,a[3],b[3],c,i[3],f[3],j,max,l,k,gou=0,gou2;
    float opi=4;
    cin>>n;
    for(l=0;l<n;l++){
        for(k=0;k<3;k++){
            cin>>a[k];
            if(a[k]>1000||a[k]<=0||l>1000){
                break;
            }
            b[k]=a[k]^2;
        }
        sort(b,b+3);
        if(b[2]==b[0]+b[1]){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
}