Go: package main
import (
    "fmt"
    "os"
    "bufio"
    "strconv"
    "sort"
)
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
func main(){
    sc.Split(bufio.ScanWords)
    defer out.Flush()
    n := nextInt()
    for i:=0; i<n; i++{
        data := nextInts(3)
        sort.Ints(data)
        if data[0]*data[0]+data[1]*data[1] == data[2]*data[2]{
            fmt.Fprintln(out, "YES")
        }else{
            fmt.Fprintln(out, "NO")
        }
    }
}
 
func next() string{
    sc.Scan()
    return sc.Text()
}
 
func nextInt() int{
    a, _ := strconv.Atoi(next())
    return a
}
 
func nextInts(n int) []int{
    a := make([]int, n)
    for i:=0; i<n; i++{
        a[i] = nextInt()
    }
    return a
}

C++: //
// Created by tac on 2016/10/27.
//

#include <cstdlib>
#include <iostream>

namespace {

bool is_traiangle(int a, int b, int c) {
    return (a * a == b * b + c * c) ||
           (b * b == a * a + c * c) ||
           (c * c == a * a + b * b);
}

}


int main() {
    int n;
    int a, b, c;
    std::string ans;
    std::cin >> n;
    for (int i = 0; i < n; ++i) {
        std::cin >> a >> b >> c;
        if (is_traiangle(a, b, c)) {
            ans = "YES";
        } else {
            ans = "NO";
        }
        std::cout << ans << std::endl;
    }
    return EXIT_SUCCESS;
}

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

int main(){
    
    int a[3];
    int i,j,tmp;
    
    while(cin>>a[0]>>a[1]>>a[2]){
        
        for(i=0;i<2;i++){
            for(j=i+1;j<3;j++){
                if(a[j]>a[i]){
                    tmp=a[i];
                    a[i]=a[j];
                    a[j]=tmp;
                }
            }
            
            
        }
        
        if(pow(a[0],2)==pow(a[1],2)+pow(a[2],2)){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    
    }

}

C++: #include <bits/stdc++.h>

using namespace std;

    // always declare big array here it's safer for stack than inside of main

    bool isRight(int a , int b , int c){
        a = a * a;
        b = b * b;
        c = c * c;

        return a == b + c || b == a + c || c == a + b;
    }

int main(){

         // cin.sync_with_stdio(0); to speed input but scanf and printf faster
         // cin.tie(0);             not use scanf after that and not use endl but \n

         // element before me is (i - 1) * m + m - 1

		 ios_base::sync_with_stdio(false);
		 cin.tie(NULL);
		 cout.tie(NULL);

         int n;
         cin >> n;

         while(n--){
            int x , y , z;
            cin >> x >> y >> z;

            if(isRight(x , y , z))
                cout << "YES" << endl;
            else cout << "NO" << endl;
         }

    return 0;
}

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

int main(){
	using namespace std;
	int n;
	while(cin >> n&&n){
		long int a[3] = { 0 };
		cin >> a[0] >> a[1] >> a[2];
		sort(a,a+3);
		if((a[2]^2) == (a[0]^2)+(a[1]^2)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  int n;
  cin >> n;
  rep(i, n){
    ll a, b, c;
    cin >> a >> b >> c;
    ll mini = min(a, min(b, c));
    ll maxi = max(a, max(b, c));
    ll mid = a + b + c - mini - maxi;
    if(mini * mini + mid * mid == maxi * maxi)cout << "YES" << endl;
    else cout << "NO" << endl;
  }
	return 0;
}

C++: #include<iostream>

using namespace std;

//??\?????????
void swap(int *a, int *b){
	int temp = *a;
	*a = *b;
	*b = temp;
}

int main(){

	int num,i,j;
	
	cin >> num;
	
	int a[num],b[num],c[num];
	
	for(i=0;i<num;i++){
		cin >> a[i] >> b[i] >> c[i];
	}
	
	int t[3];
	for(i=0;i<num;i++){
		t[0] = a[i];
		t[1] = b[i];
		t[2] = c[i];
		
		int max,str;
		str = 1;
		while(str<=3){
			max = t[str-1];
			for(j=str;j<3;j++){
				if(max<t[j]){
					max = t[j];
					swap(t[str-1],t[j]);
				}
			}
			str++;
		}
		if(t[0]*t[0]==t[1]*t[1]+t[2]*t[2])
			cout << "YES\n";
		else cout << "NO\n";
	}
	
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
    int n;
    cin>>n;
    while (n--)
        {
            int a,b,c;
            cin>>a>>b>>c;
            if (a*a + b*b =c*c)
            
                cout<<"YES";
                else 
                    cout<<"NO";
            
        }
    return 0;
}

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

int main()
{
	int a, b, c[4],d;
	cin >> a;
	for (b = 1; b <= a; b++)
	{	
		for(d=1;d<=3;d++)
			cin >> c[b];
		if (c[1] * c[1] == c[2] * c[2] + c[3] * c[3] || c[2] * c[2] == c[1] * c[1] + c[3] * c[3] || c[3] * c[3] == c[2] * c[2] + c[1] * c[1])
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int num;
  int a,b,c;
  bool ke[999]={false};
  int i;
  cin>>num;
  for(i=0;i<num;i++){
    cin>>a>>b>>c;
    if(a*a+b*b==c*c) ke[i]=true;
  }
  for(i=0;i<num;i++){
    if(ke[i]) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,a,b,c;
    cin >> n
    while(n--){
        cin >> a >> b >> c;
        if(a<b) swap(a,b);
        if(a<c) swap(a,c);
        if((a*a)==(b*b+c*c))    cout << "YES\n";
        else cout << "NO\n";
    }
}

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

int main(){
    int N(0);
    cin >> N;
    
    int answer[N];
    int i(0);
    
    while(i < N){
        int a(0), b(0), c(0);
        cin >> a >> b >> c;
    
        answer[i] = 0;
        
        if (a > b && a > c){
            if(b*b + c*c == a*a) answer[i] = 1;
        }if (b > c && b > a){
            if(c*c + a*a == b*b) answer[i] = 1;
        }if (c > a && c > b){
            if(a*a + b*b == c*c) answer[i] = 1;
        }
        i++;
    }
    
    for(i=0; i<N;i++){
        if(answer[i] == 1) printf("YES\n");
        else printf("No\n");
    }
    return 0;
}

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

C++: 
#include<stdio.h>
#include<math.h>
int main()
{
	int n,tmp;
	double a, b, c;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d %d %d", &a, &b, &c);
		if (a > b)
		{
			tmp = a;
			a = b;
			b = tmp;
			if (b > c)
			{
				tmp = c;
				c = b;
				b = a;
				a = tmp;
				if (a > b)
				{
					tmp = a;
					a = b;
					b = tmp;
				}
			}
			else if (a > c)
			{
				tmp = c;
				c = a;
				a = tmp;
			}
		}
		else if (a > c)
		{
			tmp = c;
			c = a;
			a = tmp;
			if (a > b)
			{
				tmp = a;
				a = b;
				b = tmp;
			}
		}
		pow(c, 2.0);
		if (c== a*a + b*b)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
	}
	return 0;
}