Go: package main

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

func sliceAtof64(sa []string) ([]float64, error) {
	si := make([]float64, 0, len(sa))
	for _, a := range sa {
		i, err := strconv.ParseFloat(a, 64)
		if err != nil {
			return si, err
		}
		si = append(si, i)
	}
	return si, nil
}

func answer(ans bool) {
	if ans {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
func isRightTriangle(ary []float64) (ans bool) {
	sort.Sort(sort.Reverse(sort.Float64Slice(ary)))
	ans = math.Pow(ary[1], 2.0)+math.Pow(ary[2], 2.0) == math.Pow(ary[0], 2.0)

	return
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	lineCount, _ := strconv.Atoi(scanner.Text())
	lines := make([]string, lineCount)

	for i := 0; i < lineCount; i++ {
		scanner.Scan()
		lines[i] = scanner.Text()
	}

	for _, v := range lines {
		ary, _ := sliceAtof64(strings.Split(v, " "))
		answer(isRightTriangle(ary))
	}
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		int v1,v2,v3;
		vector<int> v;
		cin >>v1>>v2>>v3;
		v.push_back(v1);
		v.push_back(v2);
		v.push_back(v3);
		sort(v.begin(),v.end(),greater<int>());
		cout <<(v[0]*v[0] == v[1]*v[1]+v[2]*v[2]?"YES":"NO")<< endl;
	}
	return 0;
}

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

using namespace std;

void solve(int a, int b, int c) {
	bool f = false;
	int max_num = max(a, max(b, c));
	int sub1, sub2;
	if (max_num != a) {
		sub1 = a;
		if (max_num != b) sub2 = b;
		else sub2 = c;
	} else if (max_num != b) {
		sub1 = b;
		sub2 = c;
	} 		
	if (pow(max_num, 2) == pow(sub1, 2) + pow(sub2, 2)) f = true;
	if (f) cout << "YES" << endl;
	else cout << "NO" << endl;
}

int main() {
	int num, a, b, c;
	cin >> num;
	for (int i=0; i<num; i++) {
		cin >> a >> b >> c;
		solve(a,b,c);
	}
	return 0;
}

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

using namespace std;

int main(void){
  int deta;
  //データ数をもらう
  scanf("%d", &deta);

  //データ数だけ３辺の値をもらう
  for(int i = 0; i < deta; i++){
    int hen1, hen2, hen3;
    scanf("%d", &hen1);
    scanf("%d", &hen2);
    scanf("%d", &hen3);

    //直角三角形の判定
    if(hen1*hen1 + hen2*hen2 == hen3*hen3 ||
       hen2*hen2 + hen3*hen3 == hen1*hen1 ||
       hen3*hen3 + hen1*hen1 == hen2*hen2){
      printf("YES\n");
    }else{
      printf("NO\n");
    }

    
  }


  return 0;
}

C++: #include <iostream>
//#include <cstdio>
//#include <cmath>
using namespace std;
 
//0003
int main(){
	int n;
	int a, b, c, a2, b2, c2;
	cin >> n;
	while(n--){
		cin >> a >> b >> c;
		a2 = a*a;
		b2 = b*b;
		c2 = c*c;

		if(a==b && b==c){
			cout << "NO" << endl;
			continue;
		}
		if(a2==b2+c2 || b2==a2+c2 || c2==a2+b2){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
	{
		int a = 0, b = 0, c = 0;
		bool henA = false, henB = false, henC = false, y = false;
		while (cin >>a>>b>>c)
		{
			
				if (a % 3 == 0 && !henA){ henA = true; }
				if (a % 4 == 0 && !henB){ henB = true; }
				if (a % 5 == 0 && !henC){ henC = true; }
				if (b % 3 == 0 && !henA){ henA = true; }
				if (b % 4 == 0 && !henB){ henB = true; }
				if (b % 5 == 0 && !henC){ henC = true; }
				if (c % 3 == 0 && !henA){ henA = true; }
				if (c % 4 == 0 && !henB){ henB = true; }
				if (c % 5 == 0 && !henC){ henC = true; }

				if (henA && henB && henC && !y){
					cout << "YES" << endl;
					y = true;
				}
				else{
					henA = henB = henC = false;
					if (c % 3 == 0 && !henA){ henA = true; }
					if (c % 4 == 0 && !henB){ henB = true; }
					if (c % 5 == 0 && !henC){ henC = true; }
					if (a % 3 == 0 && !henA){ henA = true; }
					if (a % 4 == 0 && !henB){ henB = true; }
					if (a % 5 == 0 && !henC){ henC = true; }
					if (b % 3 == 0 && !henA){ henA = true; }
					if (b % 4 == 0 && !henB){ henB = true; }
					if (b % 5 == 0 && !henC){ henC = true; }
				}
				if (henA && henB && henC && !y){
					cout << "YES" << endl;
					y = true;
				}
				else{
					henA = henB = henC = false;
					if (b % 3 == 0 && !henA){ henA = true; }
					if (b % 4 == 0 && !henB){ henB = true; }
					if (b % 5 == 0 && !henC){ henC = true; }
					if (c % 3 == 0 && !henA){ henA = true; }
					if (c % 4 == 0 && !henB){ henB = true; }
					if (c % 5 == 0 && !henC){ henC = true; }
					if (a % 3 == 0 && !henA){ henA = true; }
					if (a % 4 == 0 && !henB){ henB = true; }
					if (a % 5 == 0 && !henC){ henC = true; }
				}
				if (henA && henB && henC && !y){
					cout << "YES" << endl;
					y = true;
				}
				else{
					henA = henB = henC = false;
					if (c % 3 == 0 && !henA){ henA = true; }
					if (c % 4 == 0 && !henB){ henB = true; }
					if (c % 5 == 0 && !henC){ henC = true; }
					if (b % 3 == 0 && !henA){ henA = true; }
					if (b % 4 == 0 && !henB){ henB = true; }
					if (b % 5 == 0 && !henC){ henC = true; }
					if (a % 3 == 0 && !henA){ henA = true; }
					if (a % 4 == 0 && !henB){ henB = true; }
					if (a % 5 == 0 && !henC){ henC = true; }

				}
				if (henA && henB && henC && !y){
					cout << "YES" << endl;
					y = true;
				}
				else{
					henA = henB = henC = false;
					if (a % 3 == 0 && !henA){ henA = true; }
					if (a % 4 == 0 && !henB){ henB = true; }
					if (a % 5 == 0 && !henC){ henC = true; }
					if (c % 3 == 0 && !henA){ henA = true; }
					if (c % 4 == 0 && !henB){ henB = true; }
					if (c % 5 == 0 && !henC){ henC = true; }
					if (b % 3 == 0 && !henA){ henA = true; }
					if (b % 4 == 0 && !henB){ henB = true; }
					if (b % 5 == 0 && !henC){ henC = true; }


				}
				if (henA && henB && henC && !y){
					cout << "YES" << endl;
					y = true;
				}
				else{
					henA = henB = henC = false;
					if (b % 3 == 0 && !henA){ henA = true; }
					if (b % 4 == 0 && !henB){ henB = true; }
					if (b % 5 == 0 && !henC){ henC = true; }
					if (a % 3 == 0 && !henA){ henA = true; }
					if (a % 4 == 0 && !henB){ henB = true; }
					if (a % 5 == 0 && !henC){ henC = true; }
					if (c % 3 == 0 && !henA){ henA = true; }
					if (c % 4 == 0 && !henB){ henB = true; }
					if (c % 5 == 0 && !henC){ henC = true; }

				}
				if (henA && henB && henC && !y){
					cout << "YES" << endl;
					y = true;
				}
				else if (!(henA && henB && henC )&& !y){
					henA = henB = henC = false;
					cout << "NO" << endl;

				}
		}
		return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
string isRightTriangle(int a, int b, int c) {
  for(int i = 0; i < 3; ++i) {
	if(pow(a, 2) + pow(b, 2) == pow(c, 2)) {
	  return "YES";
	}
	if(i == 0) swap(a, b);
	if(i == 1) swap(b, c);
  }
  return "NO";
}
int main() {
  int N, s1, s2, s3;
  cin >> N;
  for(int i = 0; i < N; ++i) {
	cin >> s1 >> s2 >> s3;
	cout << isRightTriangle(s1, s2, s3) << endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(void){
    int N;
    cin >> N;
    for (int i = 0; i < N; i++) {
        int a, b, c;
        cin >> a >> b >> c;
        if ((c*c) == ((a*a) + (b*b))){
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}

C++: num = []
i = 0
roop = gets.to_i

while i < roop
	a = gets
	num = []
	num = a.split(nil)
	num = num.map{|n| n.to_i}
	num.sort!

	if (num[2]**2) == ((num[1]**2) + (num[0]**2))
		puts "YES"
	else
		puts "NO"
	end

	i = i + 1
end

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

int main(){
int n;
cin >> n;
int b;
int c;
int d;
int e;
int f;
int g;
int a;
a=0;
while(a<n){
cin >> b;
cin >> c;
cin >> d;
e=b*b;
f=c*c;
g=d*d;
if(e==f+g){cout <<"YES"<<endl;}
else if(f==e+g){cout <<"YES"<<endl;}
else if(g==f+e){cout <<"YES"<<endl;}
else{cout <<"NO"<<endl;}
a=a+1;}
    return 0;
}