Go: package main

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

func sliceAtof64(sa []string) ([]float64, error) {
	si := make([]float64, 0, len(sa))
	for _, a := range sa {
		i, err := strconv.ParseFloat(a, 64)
		if err != nil {
			return si, err
		}
		si = append(si, i)
	}
	return si, nil
}

func answer(ans bool) {
	if ans {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
func isRightTriangle(ary []float64) (ans bool) {
	sort.Sort(sort.Reverse(sort.Float64Slice(ary)))
	ans = math.Pow(ary[1], 2.0)+math.Pow(ary[2], 2.0) == math.Pow(ary[0], 2.0)

	return
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	lineCount, _ := strconv.Atoi(scanner.Text())
	lines := make([]string, lineCount)

	for i := 0; i < lineCount; i++ {
		scanner.Scan()
		lines[i] = scanner.Text()
	}

	for _, v := range lines {
		ary, _ := sliceAtof64(strings.Split(v, " "))
		answer(isRightTriangle(ary))
	}
}

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

C++: #include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <iostream>
#include <set>
using namespace std;
typedef long long ll;

int N;

int main(int argc, char const *argv[]) {
	cin >> N;
	int a[3];
	for (int 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" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, const char * argv[])
{
    int x1=0;
    int x2=0;
    int x3=0;
    int n=0;
    
    scanf("%d",&n);
    for(int i=0; i<n; i++){
        scanf("%d",&x1);
        scanf("%d",&x2);
        scanf("%d",&x3);
        if(x1*x1+x2*x2==x3*x3||x2*x2+x3*x3==x1*x1||x3*x3+x1*x1==x2*x2){
            printf("YES\n");
        }else{
            printf("NO\n");
        }
    }
}

C++: #include <iostream>
using namespace std;
int main(){
int ans=0;
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){
	ans=ans+1;}
		else if(b*b==a*a+c*c){
		ans=ans+1;}
		else if(c*c==a*a+b*b){
		ans=ans+1;}
	if(ans==1){
	cout<<"YES"<<endl;}
	if(ans!=1){
	cout<<"NO"<<endl;}
	}
return 0;
}

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

int main() {
	int n, a, b, c, A, B, C;

	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> a >> b >> c;
		A = a * a;
		B = b * b;
		C = c * c;

		if (A + B == C || A + C == B || B + C == A) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
}

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

using namespace std;

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

C++: #include <iostream>

bool judge_tri(int x1, int x2, int x3);

int main()
{
	int data_num;
	std::cin >> data_num;
	while (data_num >= 1) {
		int x1, x2, x3;
		std::cin >> x1 >> x2 >> x3;
		if (judge_tri(x1, x2, x3)) {
			std::cout << "YES" << std::endl;
		} else {
			std::cout << "NO" << std::endl;
		}
		data_num--;
	}
	return 0;
}

bool judge_tri(int x1, int x2, int x3)
{
	bool result;
	if (x1 * x1 == x2 * x2 + x3 * x3) {
		result = true;
	} else if (x2 * x2 == x3 * x3 + x1 * x1) {
		result = true;
	} else if (x3 * x3 == x1 * x1 + x2 * x2) {
		result = true;
	} else {
		result = false;
	}
	return result;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <math.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
using namespace std;
#define rep(I,N) for(int I = 0; I < (int)(N); I++)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;

int main(void){
	int N;
	cin >> N;
	rep(k, N){
		int a, b, c;
		cin >> a >> b >> c;
		a = pow(a, 2);
		b = pow(b, 2);
		c = pow(c, 2);
		bool flag = false;
		if(sqrt(c) == sqrt(a + b))flag = true;
		if(sqrt(b) == sqrt(a + c))flag = true;
		if(sqrt(a) == sqrt(b + c))flag = true;
		if(flag)cout << "YES"<<endl;
		else FIN("NO");

	}

	return 0;	
}

C++: #Include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
typedef vector<int> VI;
#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )

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

    vector<vector<int>> triangles;
    
    int n;
    cin >> n;
    
    REP(i, 0, n) {
        vector<int> tmp;
        int a, b, c;
        cin >> a >> b >> c;
        tmp.push_back(a);
        tmp.push_back(b);
        tmp.push_back(c);
        
        sort(tmp.begin(), tmp.end());
        triangles.push_back(tmp);
    }

    for(auto sides : triangles) {
        if (sides[2] * sides[2] == sides[0]*sides[0]+sides[1]*sides[1]) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    
    return 0;
}