Go: package main
import (
        "fmt"
)

func main() {
        var num int
        fmt.Scan(&num)

        for i := 0; i < num; i++ {
                s1 := 0
                s2 := 0
                s3 := 0
                var chk int = 0
                fmt.Scanf("%d %d %d", &s1, &s2, &s3)
                if s1 >= s2 {
                        if s1 > s3 {
                                chk = 1
                        } else {
                                chk = 3
                        }
                } else {
                        if s2 >= s3 {
                                chk = 2
                        } else {
                                chk = 3
                        }
                }

                if (chk == 1 && s1*s1 == s2*s2 + s3*s3) ||
                        (chk == 2 && s2*s2 == s3*s3 + s1*s1) ||
                        (chk == 3 && s3*s3 == s1*s1 + s2*s2) {
                        fmt.Printf("YES\n")
                } else {
                        fmt.Printf("NO\n")
                }
        }
}

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

bool is_right_triangle(int a, int b, int c){
  // a2 >= b2 >= c2
  int a2, b2, c2;
  
  if(a >= b && a >= c){
    a2 = a * a;
    
    if(b >= c){
      b2 = b * b;
      c2 = c * c;
    } else {
      b2 = c * c;
      c2 = b * b;
    }
  } else if(b >= a && b >= c){
    a2 = b * b;

    if(a >= c){
      b2 = a * a;
      c2 = c * c;
    } else {
      b2 = c * c;
      c2 = a * a;
    }
  } else if(c >= a && c >= b){
    a2 = c * c;

    if(a >= b){
      b2 = a * a;
      c2 = b * b;
    } else {
      b2 = b * b;
      c2 = a * a;
    }
  }

  cout << a2 << endl;
  cout << b2 << endl;
  cout << c2 << endl;

  return true;
}

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

  int a,b,c;

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

    if(is_right_triangle(a, b, c)) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  
  return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include<iostream>
using namespace std;
int main(void){
    int a{},b{},c{},n{};
    cin>>n;
    for(int i=0;i<n;i++){
        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<string>

using namespace std;

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

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

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

int main(void)
{
    int n, a, b, c;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a >> b >> c;
        int min, mid, max;
        min = (a < b && a < c)? a : (b < a && b < c)? b : c;
        max = (a > b && a > c)? a : (b > a && b > c)? b : c;
        mid = (a!=min && a!=max)? a : (b!=min &&b!=max)? b : c;
        cout << min << " " << mid << " " << max << endl;
        cout << ((pow(min, 2.0) + pow(mid, 2.0) == pow(max, 2.0))? "YES" : "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;
    n<=1000;
    for(l=0;l<n;l++){
        for(k=0;k<3;k++){
            cin>>a[k];
            if(a[k]>=1000||a[k]<=0){
                break;
            }
            b[k]=a[k]^2;
        }
        sort(b,b+3);
        if(b[2]==b[0]+b[1]){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
}

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

int main()
{
    int a,b,c,data=0;
    int d[3]={};
    
    cin >> data;
    
    for (int i=0; data>=i; i++) {

        cin >> d[0] >> d[1] >> d[2];
        
        sort(d,d+3);
        
        a=d[0];
        b=d[1];
        c=d[2];
        
        if (c*c == a*a+b*b) {
            cout << "YES";
        }else{
            cout << "NO";
        }
    }
}

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

int main(){
	int n, hen[3];

	cin >> n;

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

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

bool is_triangle(int l, int m, int n) {
  int sides[] = { l, m, n };
  std::sort(sides, sides + 3);
  return sides[0] * sides[0] + sides[1] * sides[1] == sides[2] * sides[2];
}

int main() {
  int n;
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    int l, m, n;
    std::cin >> l >> m >> n;
    std::cout << (is_triangle(l, m, n) ? "YES" : "NO") << std::endl;
  }
  return 0;
}

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

int main() {
	int N, A[3];
	cin >> N;
	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;
	}
}

C++: /*****include*****/
#include <iostream>
#include <fstream>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/
void swap(int *a,int *b){
	int w;
	w = *b;
	*b = *a;
	*a = w;
}
/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return;
	}
#endif
	/*****変数置き場*****/
	int integer[3];
	int n;
	cin >> n;
	while(n>0){
		cin >> integer[0] >> integer[1] >> integer[2];
		if(integer[0] > integer[2])			swap(&integer[0],&integer[2]);
		if(integer[1] > integer[2])			swap(&integer[1],&integer[2]);
		else if(integer[1] < integer[0])	swap(&integer[0],&integer[1]);
		if(integer[2] * integer[2] == integer[0] * integer[0] + integer[1] * integer[1])
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
		n--;
	}
	/*****処理部*****/
	
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

C++: #include <stdio.h>

void triangle_judge(int a, int b, int c);

int main(void)
{
    int data_set;
    int a[1000], b[1000], c[1000];
    scanf("%d", &data_set);
    for (int i = 0; i < data_set; ++i) {
        scanf("%d %d %d", &a[i], &b[i], &c[i]);
    }
    for (int i = 0; i < data_set; ++i) {
        triangle_judge(a[i], b[i], c[i]);
    }
    return 0;
}

void triangle_judge(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) {
        printf("YES\n");
    } else {
        printf("NO\n");
    }
}

C++: #include <stdio.h>

int main() {
    const char YES[] = "YES\n";
    const char NO[] = "NO\n";

    int inputSide[3];
    while (scanf("%d %d %d", &inputSide[0], &inputSide[1], &inputSide[2]) != EOF) {
        {
            bool finished = false;
            while (!finished) {
                finished = true;

                for (int i = 0; i < 3 - 1; ++i) {
                        if (inputSide[i] < inputSide[i + 1]) {
                        int temp = inputSide[i + 1];
                        inputSide[i + 1] = inputSide[i];
                        inputSide[i] = temp;
                        finished = false;
                    }
                }
            }
        }

        printf(((((inputSide[2] * inputSide[2]) + (inputSide[1] * inputSide[1])) == (inputSide[0] * inputSide[0])) ? YES : NO));
    }

    return 0;
}