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++: /* All men have limits. They learn what they are and learn
   not to exceed them, I ignore mine. -Batman           */
#include <bits/stdc++.h>
//#include <iostream>
//#include <vector>
//#include <Windows.h>
using namespace std;

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

return 0;
}

C++: #include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define vec_input(v) for(auto it=v.begin();it!=v.end();it++){cin>>*it;}
#define vec_output(v) for(auto it=v.begin();it!=v.end();it++){if(it!=v.begin())cout<<" ";cout<<*it;}cout<<endl;
#define vec_debug(v) for(auto it=v.begin();it!=v.end();it++){cerr<<*it<<" ";}cerr<<endl;
#define yn(ans) cout<<(ans?"Yes":"No")<<endl
#define YN(ans) cout<<(ans?"YES":"NO")<<endl
using namespace std;
using ll = long long;
template <typename T>T digitsum(T n);
template <typename T>bool isPrime(T n);
template <typename T>vector<pair<T, T>> prime_factor(T n);
long long int intpow(long long int,long long int);
template <typename T>T intlog(T);
long long int combination(long long int,long long int);
long long int series_sum(long long int);

int main(){
    int t,a,b,c,maxv,minv,mid;
    cin>>t;
    rep(l,t){
        cin>>a>>b>>c;
        maxv=max(a,max(b,c));
        minv=min(a,min(b,c));
        mid=a+b+c-minv-maxv;
        YN(maxv*maxv==minv*minv+mid*mid);
    }
}

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

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

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

using namespace std;

int main()
{
	int n;
	int deta[3];
	int square;

	cin >> n;
	
	for (int i = 0; i < n; i++){
		for (int j = 0; j < 3; j++){
			cin >> deta[j];
		}
		
		sort (deta, deta + 3);

		square = (deta[0] * deta[0]) + (deta[1] * deta[1]);

		if (square == deta[2] * deta[2]){
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}

	return 0;
}

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

int main(){
  int a,b,c,d,e,f,N,i;
  cin >> N;
  for(i=0;i<N;i++){
    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;
    }
  }
  return 0;
}

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;
		if(a>b&&a>c){
			if(b*b+c*c==a*a){
				cout<<"YES\n";
			}
			else{
				cout<<"NO\n";
			}
		}
		else if(b>a&&b>c){
			if(a*a+c*c==b*b){
				cout<<"YES\n";
			}
			else{
				cout<<"NO\n";
			}
		}
		else if(c>a&&c>b){
			if(a*a+b*b==c*c){
				cout<<"YES\n";
			}
			else{
				cout<<"NO\n";
			}
		}
		else{
			cout<<"NO\n";
		}
	}
}

C++: #!/usr/bin/env ruby

n = gets.split[0].to_i
1.upto(n) do |i|
  line = gets
  a, b, c = line.split.map {&:to_i}.sort
  if a ** 2 + b ** 2 == c ** 2
    puts "YES"
  else
    puts "NO"
  end
end

C++: #include <iostream>

using namespace std;

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

    cin >> n;
    while (n--) {
        cin >> a >> b >> c;
        a *= a;
        b *= b;
        c *= c;

        if ((a + b - c == 0) || (a + c - b == 0) || (b + c - a == 0))
            cout << "YES\n";
        else
            cout << "NO\n";
    }

    return 0;
}

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

int main()
{
	int top;
	int a, b, c;
	int N;

	cin >> N;

	for (int i = 0; i < N; i++){

		cin >> a >> b >> c;

		if (a > b)
			top = a;
		else top = b;

		if (c > top)
			top = c;

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int tri[3],flag[3];
	int n,i;
	while(cin>>n)
	{
		i = 0;
		while(i++ < n)
		{
			cin>>tri[0]>>tri[1]>>tri[2];
			sort(tri,tri+2);
			if(tri[0] < 0||tri[1] < 0||tri[2] < 0)
			{
				flag[i-1] = 0;
			}
			else
			{
				if(tri[0]*tri[0]+tri[1]*tri[1]==tri[2]*tri[2])
				{
					flag[i-1] = 1;
				}
				else
					flag[i-1] = 0;
			}
			
		}
		for(i = 0;i < n;i++)
		{
			if(flag[i]==1)
				cout<<"YES"<<endl;
			else
				cout<<"NO"<<endl;
		}
	}
	return 0;
}

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

int main(){
    int n;
    scanf("%d", &n);
    int sides[3];
    for (int i = 0; i < n; i++){
	cin >> sides[0] >> sides[1] >> sides[2];
	sort(sides, sides+3);
	printf("%s", (sides[0]^2 + sides[1]^2 == sides[2]^2)? "YES" : "NO");
    }
}

C++: #Include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
typedef vector<int> VI;
#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )

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

    vector<vector<int>> triangles;
    
    int n;
    cin >> n;
    
    REP(i, 0, n) {
        vector<int> tmp;
        int a, b, c;
        cin >> a >> b >> c;
        tmp.push_back(a);
        tmp.push_back(b);
        tmp.push_back(c);
        
        sort(tmp.begin(), tmp.end());
        triangles.push_back(tmp);
    }

    for(auto sides : triangles) {
        if (sides[2] * sides[2] == sides[0]*sides[0]+sides[1]*sides[1]) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    
    return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream> 
#include <string>
#include <map>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std; 
int main(){
	int N;
	cin >> N;
	for(int i=0;i<N;i++){
		int a, b, c;
		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>
#include <vector>
#include <algorithm>

#define ALL(a) a.begin(),a.end()

using namespace std;

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

  for ( int i = 0; i < n; i++ ) {
    vector<int> v;
    int t;
    for ( int j = 0; j < 3; j++ ) {
      cin >> t;
      v.push_back( t );
    }
    sort(ALL(v));

    if ( v[0] * v[0] + v[1] * v[1] == v[2] * v[2] )
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }

  return 0;
}