Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	li := make([]int, 3)

	sc.Scan()
	N, _ := strconv.Atoi(sc.Text())

	for i := 0; i < N; i++ {
		for j := 0; j < 3; j++ {
			sc.Scan()
			x, _ := strconv.Atoi(sc.Text())
			li[j] = x
		}
		sort.Ints(li)

		switch li[2]*li[2] == li[1]*li[1]+li[0]*li[0] {
		case true:
			fmt.Println("YES")
		case false:
			fmt.Println("NO")
		default:
		}
	}

}

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

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

	cin >> n;

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

		int max=a, k=b, l=c;
		if(max < b){
			max = b;
			k=a;
		}
		if(max < c){
			max = c;
			k=b;
			l=a;
		}

		if(max*max == k*k + l*l)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

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

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		vector<int> vec;
		int a, b, c;
		cin >> a >> b >> c;
		vec.push_back(a);
		vec.push_back(b);
		vec.push_back(c);
		sort( vec.begin(), vec.end() );
		if(vec[0] * vec[0] + vec[1] * vec[1] == vec[2] * vec[2]){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

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