Go: package main

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

var (
	sc = bufio.NewScanner(os.Stdin)
)

func main() {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	for i := 0; i < n; i++ {
		sc.Scan()
		edges := make([]int, 3, 3)
		cols := sort.StringSlice(strings.Split(sc.Text(), " "))
		cols.Sort()
		for i, c := range cols {
			edges[i], _ = strconv.Atoi(c)
			edges[i] = int(math.Pow(float64(edges[i]), 2))
		}
		msg := "NO"
		if edges[2] == edges[0]+edges[1] {
			msg = "YES"
		}
		fmt.Println(msg)
	}
}

C++: #include <iostream>

auto main () -> int
{
    const char * res [] = {"NO" , "YES"};
    int n;
    std::cin >> n;

    for (auto i = 0; i < n; ++ i)
    {
        int a , b , c;
        std::cin >> a >> b >> c;
        if (a > c)
        {
            std::swap (a , c);
        }
        if (b > c)
        {
            std::swap (b , c);
        }
        std::cout << res [a * a + b * b == c * c] << std::endl;
    }
}

C++: #include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <list>
#include <vector>
#include <algorithm>
#include <cassert>
#include <iterator>
#include <sstream>
#include <complex>
#include <bitset>
#include <iomanip>
#include <cctype>
#include <limits>
#include <numeric>
#include <cmath>
#include <functional>
#include <queue>
#include <cstring>

using namespace std;

typedef unsigned int uint;
typedef unsigned long long ull;

#define FORE(k,a,b) for(int k=(a); k <= (int)(b); ++k)
#define FOR(k,a,b) for(int k=(a); k < (int) (b); ++k)

#define pb push_back
#define mp make_pair
#define sfi(a) scanf("%d",&a)
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<uint> uvi;
typedef vector<uvi> uvvi;
typedef vector<vd> vvd;
typedef pair<int,int> ii;
typedef vector<pair<int,int> > vii;
typedef vector<vii> vvii;
typedef pair<uint,uint> uu;
typedef map<string, int> msi;
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define FOR_IT(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define contains(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())

int main(){

    int str[5],test;

    sfi(test);
    while(test--){

            scanf("%d%d%d",&str[0],&str[1],&str[2]);


        sort(str,str+3);

        if(str[2]*str[2]==(str[0]*str[0])+(str[1]*str[1]))
            puts("YES");
        else
            puts("NO");
    }




return 0;
}

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

using namespace std;

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

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<math.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int N;

int main(){
    cin>>N;
    int a[N][3];
    rep(i,N){
        rep(j,3){
            cin>>a[i][j];
        }
    }
    rep(i,N){
        sort(a[i],a[i]+3);
        if(pow(a[i][0],2)+pow(a[i][1],2)==pow(a[i][2],2)){
            out("Yes");
        }
        else{
            out("No");
        }
    }
}

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

int main(){
	vector<vector<int> > a;

	int lines = 0;
	scanf("%d", &lines);

	bool isOk[lines];
	for (int i = 0; i < lines; ++i)
	{
		int l[3];
		for (int j = 0; j < 3; ++j)
			scanf("%d", &l[j]);

		double hen[3] = {pow(l[0], 2), pow(l[1], 2) ,pow(l[2], 2)};
		if(hen[0]+hen[1] == hen[2]) isOk[i] = true;
		else if(hen[1]+hen[2] == hen[0]) isOk[i] = true;
		else if(hen[2]+hen[0] == hen[1]) isOk[i] = true;
	}

	for (int i = 0; i < lines; ++i)
	{
		if(isOk[i]) printf("YES\n");
		else printf("NO\n");
	}
}

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

	int main(){
		int data ;
			cin>>data;
			for(int n=0;n<data;n++)
			{	int i[3];
			cin>>i[0]>>i[1]>>i[2] ;
			sort(i,i+3);
				if (i[0]*i[0] + i[1]*i[1] == i[2]*i[2]){
					cout<< "YES\n";
				}else {
					cout<< "NO\n";
			}
			if ( data ==0) {
				break;
	}

	}
	 return 0;
	}

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

int is_right_triangle(int min, int mid, int max) {
  return max * max == min * min + mid * mid;
}

int main() {
  int ntriangle;
  std::cin >> ntriangle;

  for (auto i = 0; i < ntriangle; i++) {
    std::vector<int> tri;
    for (auto j = 0; j < 3; j++) {
      int len;
      std::cin >> len;
      tri.push_back(len);
    }
    std::sort(tri.begin(), tri.end());
    if (is_right_triangle(tri[0], tri[1], tri[2])) {
      std::cout << "YES\n";
    } else {
      std::cout << "NO\n";
    }
  }
  return 0;
}

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

signed main(){
        int n;
        scanf("%d", &n);
        for(int i=0;i<n;i++){
                int a,b,c;
                scanf("%d %d %d",&a,&b,&c);
                int t=std::max({a,b,c});
                if(a*a+b*b+c*c-t*t-t*t==0) printf("YES\n");
                else printf("NO\n");
        }
        return 0;
}

C++: //
//  main.cpp
//  b
//
//  Created by h3037178 on 2017/07/31.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main(){
    int n,a,i[3],f[3];
    cin>>n;
    for(int l=0;l<n;l++){
        for(a=0;a<3;a++){
        cin>>i[a];
            if(i[a]<=0){
                break;
            }
            f[a]=i[a]^2;
        }
        sort(f,f+3);
        if(f[2]==f[0]+f[1]){
            cout<<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }
}

C++: #include <bits/stdc++.h>
#define LL long long
#define ULL unsigned long long
#define rep(i, n) for (int i=0; i<(n); i++)
#define rep2(i, x, n) for (int i=x; i<(n); i++)
using namespace std;
int main(){
     
    cin.tie(0);
    ios::sync_with_stdio(false);
     
    int n;
    cin >> n;
     
    rep(i,n){
         
        int a, b, c;
        cin >> a >> b >> c;
         
        if(a>b&&a>c){
            cout << ( (a == b) == c ? "NO" : b*b + c*c == a*a ? "YES" : "NO" ) << endl;
        }else if(b>a&&b>c){
            cout << ( (a == b) == c ? "NO" : a*a + c*c == b*b ? "YES" : "NO" ) << endl;
        }else{
            cout << ( (a == b) == c ? "NO" : a*a + b*b == c*c ? "YES" : "NO" ) << endl;
        }
    }
    return 0;
}

C++: #include<iostream>

using namespace std;

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

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

using namespace std;

int N;
int a,b,c;

int main(){
	cin >> N;

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

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

    return 0;
}