Go: package main

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

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)
		fmt.Fprintln(out, checkTriangle(data))
	}
}

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
}

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)
}

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

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 = tmp;
				if (a > b)
				{
					tmp = a;
					a = b;
					b = tmp;
				}
			}
			else if (a > c)
			{
				tmp = c;
				c = a;
				a = tmp;
			}
		}
		else if (a > c)
		{
			tmp = c;
			c = a;
			a = tmp;
			if (a > b)
			{
				tmp = a;
				a = b;
				b = tmp;
			}
		}
		pow(c, 2.0);
		if (c== a*a + b*b)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
#define fo(x,a,b) for(register int x=a;x<=b;x++)
#define dfo(x,a,b) for(register int x=a;x>b;x--)
using namespace std;
int n,ans;
long double l1,l2,l3;
int main ()
{
	//freopen("")

	scanf("%d",&n);
	fo(i,1,n)
	{
		scanf("%Lf%Lf%Lf",&l1,&l2,&l3);		
		l1*=l1;
		l2*=l2;
		l3*=l3;
		if (l1+l2==l3||l2+l3==l1||l1+l3==l2) printf("YES\n");
		else printf("NO\n");
	}
//	printf("%d",ans);
	return 0;
}

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

C++: #include<bits/stdc++.h>

using namespace std;

int main(){
  int n, a[3];
  cin >> n;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < 3; j++)
      cin >> a[j];
    sort(a, a + 3);
    cout << (a[2] * a[2] == a[0] * a[0] + a[1] * a[1] ? "YES\n" : "NO\n");
  }
}

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

bool judge_triangle(int j_edge[])
{
    std::sort(j_edge, j_edge + 3); 
    return j_edge[2] * j_edge[2] == j_edge[0] * j_edge[0] + j_edge[1] * j_edge[1];
}

int main()
{
    int num;
    std::cin >> num;

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

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

        if (judge_triangle(edge)) {
            std::cout << "YES" << std::endl;
        } else {
            std::cout << "NO" << std::endl;
        }
    }   
    return 0;
}

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

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

C++: #include<stdio.h>

int main(void)
{
	int i;
	int x[1000]={0},y[1000]={0},z[1000]={0},hantei[1000]={0};
	int j=0,e =0;

	while(e==0)
	{
		scanf("%d %d %d",&x[j],&y[j],&z[j]);
		
		if(x[j]<=0 || 1000<x[j] || y[j]<=0 || 1000<y[j] || z[j]<=0 || 1000<z[j])break;

		j=j+1;
	}

	for(i=0;i<j;i++)
	{
		if(y[i]<x[i] && z[i]<x[i])
		{
			if(x[i]*x[i] == y[i]*y[i]+z[i]*z[i])
				hantei[i]=1;
		}
		else if(x[i]<y[i] && z[i]<y[i])
		{
			if(y[i]*y[i] == x[i]*x[i]+z[i]*z[i])
				hantei[i]=1;
		}
		else
		{
			if(z[i]*z[i] == x[i]*x[i]+y[i]*y[i])
				hantei[i]=1;
		}
	   
	switch(hantei[i])
	    {
		   case 0:
			  printf("No\n");
			  break;
		   case 1:
			  printf("Yes\n");
		      break;
	   }
	}

	return 0;
}

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

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

C++: 

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

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

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

C++: #include <iostream>

using namespace std;

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

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

#define pb push_back
#define fr first
#define sc second
typedef pair<int,int> pii;
typedef vector<int> vi;
const int INF = (1<<25);
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

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

C++: /*
C++ ???????????????????????????????????¬??????
??????AOJ-ITP1??????????????????
*/
#define _USE_MATH_DEFINES

#include <iostream> // ?¨??????\??????
#include <fstream>  // ??????????????\??????
#include <string>   // ???????????¢???
#include <vector>   // ???????????????
#include <cmath>    // ??°??????
#include <iomanip>  // stream???????????¢???
#include <algorithm>// max??¢??°??????

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;        // ????´???°????????????????????????
using std::fixed;         // ???????????????????¨???????????????????????????????
using std::setprecision;  // ?????°????°???°?????\???????????°????????????????????¨????????\???
using std::sort;
int main() {
	int num;
	int sides[3];

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

		cin >> sides[0] >> sides[1] >> sides[2];
		sort(sides, sides+3);
		for (size_t j = 0; j < 3; j++)
		{
			// ?????§??????
			a = std::pow(sides[0], 2);
			b = std::pow(sides[1], 2);
			c = std::pow(sides[2],2);	
		}
		if ((a + b) == c) {
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}

	return 0;
}

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

using namespace std;

class cIsRightTriangle
{
public:
	bool judge(vector<int>&);
};

bool cIsRightTriangle::judge(vector<int> &v)
{
	sort(v.begin(), v.end());
	if (v[2] * v[2] == (v[0] * v[0] + v[1] * v[1]))
		return true;
	else
		return false;
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	cIsRightTriangle ct;
	vector<int> vd(3);

	for (int i = 0; i < n; ++i)
	{
		cin >> vd[0] >> vd[1] >> vd[2];
		cout << (ct.judge(vd) ? string("YES") : string("NO")) << endl;
	}

	return 0;
}