Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	li := make([]int, 3)

	sc.Scan()
	N, _ := strconv.Atoi(sc.Text())

	for i := 0; i < N; i++ {
		for j := 0; j < 3; j++ {
			sc.Scan()
			x, _ := strconv.Atoi(sc.Text())
			li[j] = x
		}
		sort.Ints(li)

		switch li[2]*li[2] == li[1]*li[1]+li[0]*li[0] {
		case true:
			fmt.Println("YES")
		case false:
			fmt.Println("NO")
		default:
		}
	}

}

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

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

int main(){
	int num;//number of data sets
	int temp;

	cin >> num;

	int a[num],b[num],c[num];
	double x,y,z;

	for (int i = 0; i < num; i++)
	{
		cin >> a[i] >> b[i] >> c[i];
	}

	//直角三角形の判別
	for (int i = 0; i < num; i++)
	{
		if (a[i] > b[i])
		{
			temp = a[i]; 
			a[i] = b[i]; 
			b[i] = temp;
		}
		if (b[i] > c[i])
		{
			temp = b[i];
			b[i] = c[i];
			c[i] = temp;
		}

		x = c[i]*c[i];
		y = a[i]*a[i];
		z = b[i]*b[i];

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

	}

	return 0;
}

C++: #include<iostream>

using namespace std;

//??\?????????
void swap(int *a, int *b){
	int temp = *a;
	*a = *b;
	*b = temp;
}

int main(){

	int num,i,j;
	
	cin >> num;
	
	int a[num],b[num],c[num];
	
	for(i=0;i<num;i++){
		cin >> a[i] >> b[i] >> c[i];
	}
	
	int t[3];
	for(i=0;i<num;i++){
		t[0] = a[i];
		t[1] = b[i];
		t[2] = c[i];
		
		int max,str;
		str = 1;
		while(str<=3){
			max = t[str-1];
			for(j=str;j<3;j++){
				if(max<t[j]){
					max = t[j];
					swap(t[str-1],t[j]);
				}
			}
			str++;
		}
		if(t[0]*t[0]==t[1]*t[1]+t[2]*t[2])
			cout << "YES\n";
		else cout << "NO\n";
	}
	
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    vector<int> a;
    int n;
    cin>>n;
    while(n--){
        int t;
        for(int i=0;i<3;i++){
            cin>>t;
            a.push_back(t);
        }
        sort(a.begin(),a.end());
        if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
}

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

#define F(I,J,N) for(int I=J;I<N;I++)

int main(){
	priority_queue<int> q;
	int n,a,b,c;
	cin>>n;
	F(i,0,n){
		cin>>a>>b>>c;
		q.push(a);q.push(b);q.push(c);
		a=q.top();q.pop();b=q.top();q.pop();c=q.top();q.pop();
		bool f=false;
		if(a*a==(b*b+c*c)) f=true;
		if(f) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include <iostream>

inline bool is_right_triangle(const u_int a, const u_int b, const u_int c) {
    return (a*a == b*b + c*c || b*b == c*c + a*a || c*c == a*a + b*b);
}

int main(void) {
    u_int n, a, b, c;

    std::cin >> n;
    for (u_int i = 0; i < n; ++i) {
        std::cin >> a >> b >> c;
        std::cout << is_right_triangle(a, b, c) ? "YES\n" : "NO\n";
    }

    return 0;
}

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

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

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

int main(){
int n;
int a,b,c;

scans(" %d",&n);

for(int i=0;i<n;i++){
scanf(" %d %d %d",&a,&b,&c);
if(a*a==b*b+c*c||c*c==b*b+a*a||b*b=a*a+c*c){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
}

return 0;
}

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

bool solve(int x,int y,int z) ;

bool ans = false ;

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

	bool ans = false ;

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

		if( a > b )
		{
			if( a > c )		// 最大値はa
			{
				ans = solve(a,b,c) ;
			}
			else if( a < c )	// 最大値はc
			{
				ans = solve(c,a,b) ;
			}
		}
		else if( a < b )
		{
			if( b > c )		// 最大値はb
			{
				ans = solve(b,a,c) ;
			}
			else if( b < c )	// 最大値はc
			{
				ans = solve(c,a,b) ;
			}
		}

		if( ans == true ){ cout << "YES\n" ; }
		else{ cout << "NO\n" ; }
	}
	return 0 ;
}

bool solve(int x,int y, int z)
{
	if( x*x == (y*y + z*z) )
	{
		return true ;
	}
	else
	{
		return false ;
	}
}

C++: #include <math.h>
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>

#define YES "YES"
#define NO "NO"

using namespace std;

void func();
int n;

int main(void)
{
	
	func();

	return 0;
}

void func()
{
	cin >> n;

	while (n-- > 0)
	{
		int edge[3];
		for (int i = 0; i < 3; i++)
		{
			cin >> edge[i];
			edge[i] *= edge[i];	// 2?????????
		}
		sort(edge, edge + 3);

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

C++: #include<iostream>
int main()
{
	int a, b, c, d, c2;
	a = 0;
	b = 0;
	c = 0;
	d = 0;
	c2 = 0;
	while(cin >> a >> b >> c)
	{
		d = a * a + b * b;
		c2 = c * c; 
		if( d == c2 )
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

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


int main(){

  int n;
  cin >> n;

  vector <int> array(n,0);

  for(int i = 0; i < n;i++){
    for(int j = 0;j < 3;j++){
      cin >> array[j];
    }
    sort(array.begin(),array.end());

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


  return 0;
}

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

int main(){
  int a,b,c,d,e,f,g,N,i;
  cin >> N;
  for(i=0;i<=N-1;i++){
    cin >> a >> b>>c;
    d=a*a;
    e=b*b;
    f=c*c;
    g=d+e;
    if(g==f){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}

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

int main()
{
	int N;
	while (cin >> N)
	{
		for (int i = 0; i < N; i++)
		{
			int a, b, c;
			cin >> a >> b >> c;
			
			bool A = a * a + b * b == c * c;
			bool B = c * c + b * b == a * a;
			bool C = a * a + c * c == b * b;
			if (A || B || C)
			{
				cout << "YES" << endl;
			}
			else
			{
				cout << "NO" << endl;
			}
		}
	}



	return 0;
}