Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	// sc.Split(bufio.ScanLines)
	sc.Split(bufio.ScanWords)
	n, _ := strconv.Atoi(read())
	s := make([]int, 3)
	for i := 0; i < n; i++ {
		s[0], _ = strconv.Atoi(read())
		s[1], _ = strconv.Atoi(read())
		s[2], _ = strconv.Atoi(read())
		sort.Sort(sort.IntSlice(s))
		if (s[2] * s[2]) == ((s[0] * s[0]) + (s[1] * s[1])) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

int main() {
    int N, a, b;
    cin >> N;
    vector<int>triangle(3);
    for(int i = 0; i < N; i++){
      for(int j = 0; j < 3; j++){
        cin >> triangle.at(j);
      }
      sort(triangle.begin(), triangle.end());

      int A, B, C;

      A = triangle.at(0);
      B = triangle.at(1);
      C = triangle.at(2);

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

C++: #include<iostream>
using namespace std;
int main() {
	int data_lim;
	cin >> data_lim;
	for(int cnt=0;cnt<data_lim;cnt++) {
		int a,b,c;
		cin >> a >> b >> c;
		
		bool flg = false;
		// ピタゴラスの定理を適用
		if(a*a == b*b+c*c)
			flg = true;
		else if(b*b == a*a+c*c)
			flg = true;
		else if(c*c == a*a+b*b)
			flg = true;
		
		if(flg == true)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
		
	}
	
	return 0;
}

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

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

  return 0;
}

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

int main(){
	int N;
	int a,b,c;
	int i;
	
	scanf("%d",&N);
	
	for(i = 0;i < N;i++){
		scanf("%d %d %d",&a,&b,&c);
		if(pow(a,2)+pow(b,2) == pow(c,2)||pow(b,2)+pow(c,2) == pow(a,2)||pow(c,2)+pow(a,2) == pow(b,2)){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

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

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

scanf(" %d",&n);

for(int i=0;i<n;i++){
scanf(" %d %d %d",&a,&b,&c);
if(a*a==b*b+c*c||c*c==b*b+a*a||b*b=a*a+c*c){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
}

return 0;
}

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

template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
int character_count(string text, char character){ int ans = 0; for(int i = 0; i < text.size(); i++){ ans += (text[i] == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class itr, class func> void array_output(itr start, itr goal, func out = [](itr x) { return x; } ){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
template<class itr, class func> void nint_output(itr start, itr goal, func out = [](itr x) { return x; } ){ string ans; for(auto i = start; i != goal; i++){ ans += string(out(*i)) + " "; } ans.pop_back(); cout << ans << endl; }
long gcd(long a, long b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }}
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcount(n)

int main(){
    int N;
    cin >> N;
    for(int i = 0; i < N; i++){
        int nums[3];
        cin >> nums[0] >> nums[1] >> nums[2];
        sort(nums, nums + 3);
        YES(nums[0] * nums[0] + nums[1] * nums[1] == nums[2] * nums[2]);
    }
}

C++: #include <iostream>

using namespace std;

int main() {

	int dataNum;
	int hen[1000][3];

	cin >> dataNum;
	for (int i = 0; i < dataNum; i++) {
		cin >> hen[i][0] >> hen[i][1] >> hen[i][2];
	}

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

		//????????????????????§?????????
		for (int j = dataNum - 1; j > 0; j--) {
			for (int k = 0; k < j; k++) {
				if (hen[k] > hen[k + 1]) {
					int dummy = hen[i][k];
					hen[i][k] = hen[i][k + 1];
					hen[i][k + 1] = dummy;
				}
			}
		}

		//??´?§?????????§??????
		if (hen[i][0] * hen[i][0] + hen[i][1] * hen[i][1] == hen[i][2] * hen[i][2]) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}

C++: #include<iostream>

using namespace std;

//??\?????????
void swap(int *a, int *b){
	int temp = *a;
	*a = *b;
	*b = temp;
}

int main(){

	int num,i,j;
	
	cin >> num;
	
	int a[num],b[num],c[num];
	
	for(i=0;i<num;i++){
		cin >> a[i] >> b[i] >> c[i];
	}
	
	int t[3];
	for(i=0;i<num;i++){
		t[0] = a[i];
		t[1] = b[i];
		t[2] = c[i];
		
		int max,str;
		str = 1;
		while(str<3){
			max = t[str-1];
			for(j=str;j<3;j++){
				if(max<t[j]){
					swap(t[str-1],t[j]);
				}
			}
			str++;
		}
		if(t[0]*t[0]==t[1]*t[1]+t[2]*t[2])
			cout << "YES\n";
		else cout << "NO\n";
	}
	
	return 0;
}

C++: #include <stdio.h>

int weather_right_triangle(int, int, int);

int main(void)
{
	int n;
	scanf("%d", &n);
	int a[n][3];
	for (int i = 0; i < n; i++) {
		scanf("%d %d %d", &a[i][0], &a[i][1], &a[i][2]);
		weather_right_triangle(a[i][0], a[i][1], a[i][2]);
	}
	return 0;
}

int weather_right_triangle(int a, int b, int c)
{
	if (a * a + b * b == c * c || 
		b * b + c * c == a * a || 
		a * a + c * c == b * b) {
		printf("YES\n");
	} else {
		printf("NO\n");
	}
	return 0;
}

C++: #include <iostream>

int N;
int x, y, z;

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

    for(int i = 0; i<N; ++i) {
        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>
using namespace std;

int main(){

int tri[1000][3];
int num = 0;
cin >> num;
for(int i = 0;i<num;i++)
cin >> tri[i][0] >> tri[i][1] >> tri[i][2];

long int a,b,c=0;

for(int i = 0;i<num;i++){
a = tri[i][0]*tri[i][0];
b = tri[i][1]*tri[i][1];
c = tri[i][2]*tri[i][2];
if(a == b+c || b == a+c || c == a + b)
cout << "YES\n";
else
cout << "NO\n";
}
    return 0;
}

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

int main() {
    clock_t cTimeStart, cTimeEnd;
    cTimeStart = clock();           // 現在時刻
    int H[3];
    int N,total;
    cin>>N;
    for(int i=0;i<N;++i){
    	cin>>H[0]>>H[1]>>H[2];
    	sort(H,H+3);
    	total=H[2]*H[2]-(H[1]*H[1]+H[0]*H[0]);
    	if(total==0){
    		cout<<"YES"<<endl;
    	}else{
    		cout<<"NO"<<endl;

    	}
    }

    cTimeEnd = clock();           // 現在時刻
//    cout<< "処理時間:" <<(cTimeEnd - cTimeStart)/1000 << "[ms]" << endl;

	return 0;
}