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 <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#define pi 3.14159265358979323846264338
using namespace std;

int main() {
	double a, b, c;
	while (cin >> a >> b >> c) {
		if (pow(max(a, max(b, c)), 2) == pow(min(a, min(b, c)), 2) + pow(max(a, min(b, c)), 2)) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" <<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <stdlib.h>
#include <string>
#include <math.h>
#include <algorithm>

using namespace std;


int main(){
    int input[3];
    int N;
    string *str;
    
    cin >> N;
    
    str=new string[N];
    
    for(int i=0;i<N;i++){
        cin>>input[1]>>input[2]>>input[3];
        sort(input,input+3);
        if(input[1]==sqrt((pow((double)input[2],(double)2)+pow((double)input[3],(double)2)))) str[i]="YES";
        else str[i]="NO";
    }
    
    for(int i=0;i<N;i++) cout<<str[i]<<endl;
    
    delete[] str;
    
    return 0;

}

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

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);

  int i, n, a, b, c;
  vector<int> triangle;
  cin >> n;

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

    sort(triangle.begin(), triangle.end());
    if (triangle.at(0) * triangle.at(0) + triangle.at(1) * triangle.at(1) == triangle.at(2) * triangle.at(2)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }

    triangle.clear();
  }

  return 0;
}

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

using namespace std;

int main()
{
	int num;

	cin >> num;
	if(num > 1000)
		return -1;

	for(int ix = 0;ix != num;++ix){
		int set[3];
		cin >> set[0] >> set[1] >> set[2];

		int big=0,other1,other2;
		for(int ix = 0;ix != 3;++ix)
			for(int jx = 0;jx  != 3;++jx)
				if(set[ix] <= set[jx])
					if(set[big] <= set[jx])
						big = jx;
		switch(big){
		case 0:other1 = 1;other2 = 2;
		case 1:other1 = 0;other2 = 2;
		case 2:other1 = 0;other2 = 1;
		}
		if((set[other1]*set[other1] + set[other2]*set[other2])==set[big]*set[big])
			cout <<"YES"<<endl;
		else
			cout <<"NO"<<endl;
	}

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    int a,x,y,z;
    cin >> a;
    int m[3][a];
    for (int i=0;i<a;i++){
        cin >> x >> y >> z ;
        m[0][i] = x;
        m[1][i] = y;
        m[2][i] = z;
    }
    for (int j=0;j<a;j++){
        if(m[0][j]>1000 || m[1][j]>1000 || m[2][j]>1000)
            cout << "NO" << endl;
        if(m[0][j]<1 || m[1][j]<1 || m[2][j]<1)
            cout << "NO" << endl;
        if (m[0][j]^2+m[1][j]^2!=m[2][j]^2 && m[0][j]^2+m[2][j]^2!=m[1][j]^2 && m[1][j]^2+m[2][j]^2!=m[0][j]^2)
            cout << "NO" << endl;
        else
            cout << "YES" << endl;
    }
}

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

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

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

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

C++: #include <iostream>

class Triangle{
	u_int a, b, c;
public:
	Triangle(u_int x, u_int y, u_int z);
	~Triangle() = default;
	void isRightTriangle();
};

Triangle::Triangle(u_int x, u_int y, u_int z){
	a = x;
	b = y;
	c = z;
}

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

int main(){
	u_int n;
	std::cin >> n;
	
	for(u_int i = 0; i < n; ++i){
		u_int a, b, c;
		std::cin >> a >> b >> c;
		Triangle triangle(a, b, c);
		triangle.isRightTriangle();
	}
	
	return 0;
}

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


int main(){

	int size;
	cin >> size;

	struct triangle{
		int elm[3];

		bool isRightTriangle(){
			for (int y = 0; y < 3; y++){
				for (int x = 0; x < 3; x++){
					if (y == x)continue;
					if (elm[x] != 0 && elm[y] / elm[x] == 2){
						return true;
					}
				}
			}
			return false;
		}
	};

	triangle *ary = new triangle[size];

	for (int i = 0; i < size; i++){
		cin >> ary[i].elm[0] >> ary[i].elm[1] >> ary[i].elm[2];
	}

	for (int i = 0; i < size; i++){
		cout << (ary[i].isRightTriangle() ? "YES" : "NO") << endl;
	}

	delete[] ary;

	return 0;
}

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

int triangle(int a,int b,int c){
    a = a*a;
    b = b*b;
    c = c*c;

    if(a == (b+c))      return 0;
    else if(b == (a+c)) return 0;
    else if(c == (a+b)) return 0;
    else                return 1;
}

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

   scanf("%d",&n);

  while(i < n){
   scanf("%d %d %d",&a,&b,&c);
  
   if(triangle(a,b,c) == 0){ 
     cout << "YES\n";
   }else{
     cout << "NO\n"; 
 }
 i++;
}
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    while (n--)
    {
        int a,b,c,d,e,f;
        cin>>a>>b>>c;
        d=a*a;
        e=b*b;
        f=c*c;
        if (d==e+f || e==d+f || f==d+e)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
}

C++: #include <iostream>
using namespace std;
 
int main() {
    // your code goes here
    int n;
    cin >> n;
    for (int i=0;i<n;i++) {
        int a,b,c,aa,bb,cc;
        cin >> a >> b >> c;
        if (a>b&&a>c) {
            aa = a;
            bb = b;
            cc = c;
        }
        if (b>a&&b>c) {
            aa = b;
            bb = a;
            cc = c;
        }
        if (c>a&&c>b) {
            aa = c;
            bb = a;
            cc = b;
        }
         
        if (aa*aa == bb*bb + cc*cc) {
            cout << "YES" << endl;
        }
        if (aa*aa != bb*bb + cc*cc) {
            cout << "NO" <<endl;
        }
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)

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

  int a[n], b[n], c[n];

  REP(i, n) cin >> a[i] >> b[i] >> c[i];

  REP(i, n){
    if(
      a[i] * a[i] + b[i] * b[i] == c[i] * c[i] ||
      b[i] * b[i] + c[i] * c[i] == a[i] * a[i] ||
      c[i] * c[i] + a[i] * a[i] == b[i] * b[i]
    ) cout << "YES" << endl;
    else cout << "NO" << endl;
  }

  return 0;
}