Go: package main

import (
  "fmt"
)


func main() {
  var a int
  var b int
  var c int
  var n int
  fmt.Scan(&n)
  for _, err := fmt.Scan(&a, &b, &c); err == nil; _, err = fmt.Scan(&a, &b, &c) {
    if a*a == b*b+c*c {
      fmt.Println("YES")
    } else if b*b == c*c+a*a {
      fmt.Println("YES")
    } else if c*c == a*a+b*b {
      fmt.Println("YES")
    } else {
      fmt.Println("NO")
    }
  }
}

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

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

int main(){
	unsigned int N;
	unsigned int a,b,c;
	std::vector<bool> ans;

	std::cin >> N;

	for(int i = 0; i < N; i++){
		std::cin >> a >> b >> c;
		if(	(a*a + b*b == c*c) ||
			(a*a + c*c == b*b) ||
			(c*c + b*b == a*a)){
			ans.push_back(true);
		}else{
			ans.push_back(false);
		}
	}

	for(auto&& a : ans){
		if(a){
			std::cout << "YES" << std::endl;
		}else{
			std::cout << "NO" << std::endl;
		}
	}
}

C++: #include<stdio.h>
int main(){
	int N,x,y,z,i;
	scanf("%d %d %d",&x,&y,&z);
	for(i=0;i<N;i++){
		if((x^2+y^2)==z^2||(x^2+z^2)==y^2||(y^2+z^2)==x^2){
			printf("Yes\n");
		}
		else {
			printf("No\n");
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int a, b, c;
	int n;
	cin >> n;

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

		if(c * c == a * a + b * b){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
}

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


int main() {
	int n;
	cin >> n;
	int a[1000];
	int b[1000];
	int c[1000];
	int d[3];

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

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

int main(){
	int a,b,c,q;
	cin >> q;
	auto f=[&]{
		cin >> a >> b >> c;
		int x = max({a,b,c});
		int y = min({a,b,c});
		int z = a+b+c-x-y;
		if((x*x)==(y*y+z*z)){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	};
	while(q--){
		f();
	}
}