Go: package main

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

var (
	sc = bufio.NewScanner(os.Stdin)
)

func main() {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	for i := 0; i < n; i++ {
		sc.Scan()
		edges := make([]int, 3, 3)
		for i, c := range strings.Split(sc.Text(), " ") {
			edges[i], _ = strconv.Atoi(c)
			edges[i] = int(math.Pow(float64(edges[i]), 2))
		}
		sort.IntSlice(edges).Sort()
		msg := "NO"
		if edges[2] == edges[0]+edges[1] {
			msg = "YES"
		}
		fmt.Println(msg)
	}
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <set>

using namespace std;

#define ALL(co) co.begin(), co.end()

typedef long long LL;
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> Array;
typedef vector<int> LArray;

const int INF = 1 << 29;
const LL LINF = 1LL << 60;

int itiv;
inline int getInt() { return (cin >> itiv, itiv); }
void readAll(Array& vec, int n) { for (int i = 0; i < n; i++) cin >> vec[i]; }
inline bool between(int first, int last, int n) { return first <= n && n <= last; }
inline bool inRange(int begin, int end, int n) { return begin <= n && n < end; }
inline bool inRange(int size, int n) { return 0 <= n && n < size; }

int m, n;
int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, -1, 0, 1 };
int dr[] = { 0, -1, 0, 1 }, dc[] = { -1, 0, 1, 0 };


int main(void)
{
	while(cin >> n && n)
	{
		for (int i = 0; i < n; i++)
		{
			vector<int> arr(3);
			for (int i = 0; i < n; i++) cin >> arr[i];
			sort(ALL(arr));
			cout << (arr[2] * arr[2] == arr[0] * arr[0] + arr[1] * arr[1] ? "YES" : "NO") << endl;
		}
	}
	return 0;
}

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

int main()
{
    int m,n,k,j,i,sum=0;
    cin>>j;
       for(i=0;i<j;i++)
    {
    cin>>m>>n>>k;
    if(sqrt(m*m+n*n)==k)
    {
        cout<<"YES"<<endl;
    }
    else if(sqrt(m*m+k*k)==n)
        {
            cout<<"YES"<<endl;
        }
    else if(sqrt(k*k+n*n)==m)
    {
       cout<<"YES"<<endl;
    }
    else
cout<<"NO"<<endl;
    }

return 0;
}

C++: #include <iostream>

using namespace std;


bool check( int a, int b, int c )
{
	if( ( a * a ) == ( b * b ) + ( c * c ) )
	{
		return true;
	}else{
		return false;
	}
}
int main()
{
	int a, b, c, cnt;

	cin >> cnt;


	for( int i = 0; i < cnt; i++ )	
	{
		cin >> a >> b >> c;
		if( check( a, b, c ) || check( b, a, c ) || check( c, a, 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 ((c*c) == ((a*a) + (b*b))){
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}

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

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

  for(int i=0; i<N; i++){
    vector<int> l(3);
    cin >> l[0] >> l[1] >> l[2];
    sort(l.begin(), l.end());

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

C++: #include <stdio.h>

void Hantei(int a[3])
{
	int max, zako1, zako2;

	if (a[0]>a[1] && a[0]>a[2]) {
		max = a[0];
		zako1 = a[1];
		zako2 = a[2];
	}
	else if (a[1]>a[0] && a[1]>a[2]) {
		max = a[1];
		zako1 = a[0];
		zako2 = a[2];
	}
	else {
		max = a[2];
		zako1 = a[0];
		zako2 = a[1];
	}

	if (max*max == zako1*zako1 + zako2*zako2) {
		printf("YES\n");
	}
	else {
		printf("NO\n");
	}

}

int main(void)
{
	int n;
	scanf("%d", &n);

	int len[n][3];

	for (int i = 0; i<n; i++) {
		scanf("%d %d %d", &len[i][0], &len[i][1], &len[i][2]);
	}

	for (int i = 0; i<n; i++) {
		Hantei(len[i]);
	}



	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>
using namespace std;
int main()
{
    int n,a,b,c,i;
    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>
using namespace std;

int main(){
	int n,a,b,c;
	cin>>n;
	while(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"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
	}

	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
int main() {
	int n;
	std::cin >> n;
	std::vector<std::string>v;
	for (int i = 0;i < n;++i) {
		int a, b, c;
		std::cin >> a >> b >> c;
		int max = std::max(a,std::max(b,c));
		if (a*a + b*b + c*c == max*max * 2) {
			v.push_back("YES");
		}
		else {
			v.push_back("NO");
		}
	}
	for (int i = 0;n < i;++i) {
		std::cout << v[i] << std::endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <iterator>
#include <cmath>
#include <stack>
#include <functional>
using namespace std;

int main()
{
  int n;
  cin >> n;
  vector<int> tri(3);

  while(n > 0) {
    cin >> tri[0] >> tri[1] >> tri[2];
    sort(tri.begin(), tri.end());
    if(pow(tri[0], 2) + pow(tri[1], 2) == pow(tri[2], 2))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    n--;
  }
  return 0;
}

C++: #include<stdio.h>
#define MAX_N 1000

int main() {

	int i = 0;
	int N = 0;
	int a[MAX_N], b[MAX_N], c[MAX_N];

	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(a[i] * a[i] + b[i] * b[i] == c[i] * c[i]) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}

	return 0;
}

C++: #include <iostream>

void judgeTriangle(int, int, int);

int main()
{
    int number;
    std::cin >> number;
    for (int i = 0; i < number; ++i) {
        int a, b, c;
        std::cin >> a >> b >> c;
        judgeTriangle(a, b, c);
    }
    return 0;
}

void judgeTriangle(int a, int b, int c)
{
    if (a * a + b * b == c * c
        || b * b + c * c == a * a
        || c * c + a * a == b * b) {
        std::cout << "YES" << std::endl;
    } else {
        std::cout << "NO" << std::endl;
    }
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
int main(){
	int N,i;
	int count=0;
	int a[3];
	scanf("%d ",&N);
	while(count!=N){
	for(i=0;i<3;i++){
		scanf("%d ",&a[i]);
	}
	sort(a,a+3);
	if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1]){
		printf("YES\n");
		count++;
	}
	else{
		printf("NO\n");
		count++;
	}
	}
	return 0;
	}

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

bool isRightTriangle(const int &a, const int &b, const int &c)
{
    int sum = a * a + b * b + c * c;
    int max = std::max(a, std::max(b, c));
    return (sum - (max * max) == max * max);


}

int main()
{
    int N, a, b, c;
    std::scanf("%d", &N);
    for (int i = 0; i < N; i++) {
        std::scanf("%d %d %d", &a, &b, &c);
        (isRightTriangle(a, b, c)) ? std::cout << "YES" << std::endl : std::cout << "NO" << std::endl;
    }
    return 0;
}