Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	num := int(n)
	var strs []string
	var a, b, c int
	var res string
	var YES string = "YES"
	var NO string = "NO"
	for i := 0; i < num; i++ {
		scanner.Scan()
		strs = strings.Split(scanner.Text(), " ")
		a, _ = strconv.Atoi(strs[0])
		b, _ = strconv.Atoi(strs[1])
		c, _ = strconv.Atoi(strs[2])

		res = NO
		if c*c == (a*a+b*b) || b*b == (a*a+c*c) || a*a == (b*b+c*c) {
			res = YES
		}
		fmt.Printf("%s\n", res)
	}
}

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

int main() {

//変数の宣言

	vector<int> a;
	int i,j,n,temp;


/////メイン処理/////

	cin >> n;
	
	for(j=0;j<n;j++){ 
//入力
		for(i=0;i<3;i++){
			cin >> temp;
			a.push_back(temp);
		}
		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;
		}
		
	}
	
	return 0;
}

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

using namespace std;


int main(){
	int n;
	cin>>n;
	int hen1,hen2,hen3,saidai;

	for(int i=0;i<n;i++){
		cin>>hen1>>hen2>>hen3;

		saidai=hen1;
		if(saidai<hen2){
			saidai=hen2;
			hen2=0;
		}
		else if(saidai<hen3){
			saidai=hen3;
			hen3=0;
		}
		else if(saidai==hen1)
			hen1=0;
		if(saidai*saidai==hen1*hen1+hen2*hen2+hen3*hen3)
			cout<<"YES"<<"\n";
		else{
			cout<<"NO"<<"\n";
		}
	}
	
	
	return 0;
}

C++: 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
using namespace std;
 
bool check(int a, int b , int c){
    if((a * a) == (b * b + c * c) ){ 
        return true ; 
    }
    return false ;
}
 
int main(){
    int i, a, b, c;
 
    cin >> i;
    for(int j = 0 ; j < i; j++){
        cin >> a >> b >> c;
        if(check(a, b, c) || check(b, c, a) || check(c, a, b) ){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
    return 0;
}

C++: #include <iostream>

int N;
int x, y, z;

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

    for(int i = 0; i<N; ++i) {
        std::cin >> x >> y >> z;
        
        int a = std::min(x, std::min(y, z));
        int c = std::max(x, std::max(y, z));
        int b = (x + y + z) - (a + c);

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

C++: #include<iostream>
#include<queue>
using namespace std;
priority_queue<int> q1;
int main(){
	int a,b,c,d,n;
	int i,j,k;
	bool s[1005];
	cin>>n;
	for(i=0;i<n;i++){
		for(j=0;j<3;j++){
			cin>>a;
			q1.push(a);
		}
		a=q1.top();
		q1.pop();
		b=q1.top();
		q1.pop();
		c=q1.top();
		q1.pop();
		if(a*a==b*b+c*c){
			s[i]=true;
		}else{
			s[i]=false;
		}
	}
	for(i=0;i<n;i++){
		if(s[i]==true){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  long long n,a,b,c;
  cin >> n;
  long long tmp[3];
  for(int i=0;i<n;i++){
    cin >> a >> b >> c;
    tmp[0]=a;tmp[1]=b;tmp[2]=c;
    sort(tmp,tmp+n);
    if(tmp[0]*tmp[0]+tmp[1]*tmp[1]==tmp[2]*tmp[2]){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
  return 0;
}

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

int main(){
    int len[3];
    int n,A,B,C;

    cin >> n;

    for(int i = 0; i < n; ++i){
        cin >> len[0] >> len[1] >> len[2];
        sort(len, len + 3);
        A = len[0] * len[0];
        B = len[1] * len[1];
        C = len[2] * len[2];
        if(A + B == C){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}

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

int main(int argc, char const *argv[]){
	
	int side_1,side_2,side_3;
	int N;

	std::cin >> N;

	std::vector<bool> result(N);

	for (int i = 0; i < N; ++i){
		std::cin >> side_1 >> side_2 >> side_3;

		side_1 = pow(side_1,2);
		side_2 = pow(side_2,2);
		side_3 = pow(side_3,2);

		if( side_1+side_2==side_3 ||
			side_2+side_3==side_1 || 
			side_3+side_1==side_2 	){

			result[i] = true;
		}else{
			result[i] = false;
		}
	}

	for (int i = 0; i < result.size(); ++i){
		if(result[i]) std::cout << "YES" << std::endl;
		else std::cout << "NO" << std::endl;
	}

	return 0;
}

C++: //↓template↓

#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
long long fac[200005], finv[200005], inv[200005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge> >G;

long long mod_pow(long long a, long long b) {
	long long res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}

	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

//↑template↑


int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		vector<double>v(3);
		cin >> v[0] >> v[1] >> v[2];
		sort(all(v));
		if (v[2] * v[2] == (v[0] * v[0]) + (v[1] * v[1])) { cout << "YES" << endl; }
		else { cout << "NO" << endl; }
	}
}

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

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

	while (n--)
	{
		int a, b, c;
		cin >> a >> b >> c;
		//a???????????§????????????????????\?????????
		if (a < b) swap(a, b);
		if (a < c) swap(a, c);
		//??????????????????????????????
		if (a*a == b*b + c*c)
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}
	}

	return 0;
}

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

bool Pythagoras_checker(int side[3])
{
    int temp;
    
    for (int i = 0; i < 2; i++) {   //sort
        for (int j = 2; j > i; j--) {
            if (side[i] > side[j]) {
                temp = side[j];
                side[j] = side[i];
                side[i] = temp;
            }
        }
    }
    
    if (side[0] * side[0] + side[1] * side[1] == side[2] * side[2]) {
        return true;
    } else {
        return false;
    }
}

int main(void)
{
    int a;
    int side[3];

    scanf("%d", &a);
    
    for (int i = 0; i < a; i++) {
        for (int j = 0; j < 3; j++) {
            scanf("%d", &side[j]);
        }
        
        if (Pythagoras_checker(side) == true) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }

    return 0;
}

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

using namespace std;

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

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

C++: #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
    int n;
    cin>>n;
    while (n--)
        {
            int a,b,c;
            cin>>a>>b>>c;
            if (a*a + b*b ==c*c || b*b+c*c==a*a || a*a+c*c==b*b)
            
                cout<<"YES"<<endl;
                else 
                    cout<<"NO"<<endl;
            
        }
    return 0;
}

C++: #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
    int n,a[3],b[3],c,i[3],f[3],j,max,l,k,gou=0,gou2;
    float opi=4;
    cin>>n;
    for(l=0;l<n;l++){
        for(k=0;k<3;k++){
            cin>>a[k];
            if(a[k]>1000||a[k]<=0||n>1000){
                break;
            }
            b[k]=a[k]^2;
        }
        sort(b,b+3);
        if(b[2]==b[0]+b[1]){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
}