Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	nQueries := nextInt()
	for i := 0; i < nQueries; i++ {
		lengths := []int{nextInt(), nextInt(), nextInt()}
		sort.Slice(lengths, func(i, j int) bool { return lengths[i] > lengths[j] })
		if math.Pow(float64(lengths[0]), 2) == math.Pow(float64(lengths[1]), 2)+math.Pow(float64(lengths[2]), 2) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

int main(){
  using namespace std;
  int num;
  int line[1000][3];

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

C++: #include <iostream>

using namespace std;

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

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

int main() {
	int n;
	cin >> n;
	while(n--) {
		int a, b, c;
		cin >> a >> b >> c;
		a = a * a;
		b = b * b;
		c = c * c;
		cout << ((a == b + c || b == a + c || c == a + b) ? "YES" : "NO") << endl;
	}
}

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

int main(){
	int N;
	int A;
	int B;
	int C;
	string Ans[1000];
	cin>>N;
	for(int i = 0;i<N;i++){
		cin>>A>>B>>C;
		int MAX = max(A,max(B,C));
		if(MAX==A){
			if(A*A == B*B+C*C)
				Ans[i] = "YES";
			else
				Ans[i] = "NO";
		}
		else{
				if(MAX==B){				
					if(B*B==A*A+C*C)
						Ans[i] = "YES";
					else
						Ans[i] = "NO";
				}
				else{					
					if(C*C == A*A+B*B)
					Ans[i] = "YES";
					else
					Ans[i] = "NO";
				}
		}
	}
	for(int o = 0;o<N;o++){
		cout<<Ans[o]<<endl;
	}
}

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

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

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

int main(){
  int N;

  cin >> N;
  vector<int> a(N);
  vector<int> b(N);
  vector<int> c(N);

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

  for(int i=0;i<N;i++){
    int aa, bb, cc;

    aa = a.at(i) * a.at(i);
    bb = b.at(i) * b.at(i);
    cc = c.at(i) * c.at(i);

    // cout << aa << endl;
    // cout << bb << endl;
    // cout << cc  << endl;

    if(aa == bb + cc || bb == aa + cc || cc == aa + bb){
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}

C++: #include<stdio.h>
#include<string.h>

int checkRightAngle(a,b,c){
	if(a*a == b*b + c*c ||
	   b*b == a*a + c*c ||
	   c*c == a*a + b*b){
			return 1;
	}

	return 0;
}

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

	scanf("%d", &n);
	for(i=0; i<n; i++){
		scanf("%d %d %d",&a ,&b ,&c);
		if(checkRightAngle(a,b,c)){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}

	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() {
    ios::sync_with_stdio(false);
    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;
}

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

using namespace std;

int main()
{
    int ignore;
    cin >> ignore;
    int fi;
    int se;
    int th;
    vector<int> v;

    while(cin >> fi >> se >> th)
    {
        v.push_back(fi);
        v.push_back(se);
        v.push_back(th);
        sort(v.begin(), v.end(), greater<int>());
        if(v[0] * v[0] == v[1] * v[1] + v[2] * v[2])
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }
}

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

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<string>> vvs;
typedef vector<vector<char>> vvc;
typedef vector<vector<bool>> vvb;
typedef pair<int,int> P;
#define vrep(v,n) for(int i=0;i<n;i++){cin >> v.at(i);} //配列vにn個の要素を入力する
#define rep(i, l, n) for (int i = l; i < (int)(n); i++)
#define repn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 

const int mod = 1000000007;
const int inf = 1e9;

int main(){
    int n;
    cin >> n;
    rep(i,0,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(a+b==c||b+c==a||c+a==b) flag = true;
        printf("%s\n", flag?"YES":"NO");
    }
}

C++: #include<stdio.h>

int main(){
        int i = 0;
        int n,len[3];
        scanf("%d",&n);
        while(i != n){
                scanf("%d %d %d",&len[0],&len[1],&len[2]);
                if(len[0] * len[0] + len[1] * len[1] == len[2] * len[2]){
                        printf("YES\n");
                }else{
                        printf("NO\n");
                }
                i++;
        }
        return 0;
}

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

void F(int *a, int*b) {
	int x;
	x = *a;
	*a = *b;
	*b = x;
}

int main() {
	int n, a, b, c;
	cin >> n;
	for (int i = 0;i < n;i++) {
		cin >> a >> b >> c;
		if (c < a)
			F(&c, &a);
		if (c < b)
			F(&c, &b);

		if (a*a + b*b == c*c)
			printf("YES\n");
		else
			printf("NO\n");
	}
}

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