Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

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)
		fmt.Fprintln(out, checkTriangle(data))
	}
}

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
}

func checkTriangle(i []int) string {
	if checkSt(i[0], i[1], i[2]) || checkSt(i[1], i[2], i[0]) || checkSt(i[2], i[0], i[1]) {
		return "YES"
	}
	return "NO"
}
func Sq(x int) int {
	return x * x
}

func checkSt(a, b, c int) bool {
	return (Sq(a) + Sq(b)) == Sq(c)
}

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

int main(){
	int a,b,c;
	cin>>a;
	while(cin>>a>>b>>c){
		if(a>b){
			if(c>a){
				if(c*c==a*a+b*b){
					cout<<"YES"<<endl;
				}else{
					cout<<"NO"<<endl;
				}
			}else{
				if(a*a==c*c+b*b){
					cout<<"YES"<<endl;
				}else{
					cout<<"NO"<<endl;
				}
			}
		}else{
			if(c>b){
				if(c*c==a*a+b*b){
					cout<<"YES"<<endl;
				}else{
					cout<<"NO"<<endl;
				}
			}else{
				if(b*b==c*c+a*a){
					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,a[3];

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

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

int main(){
        int n,a,b,c;
        std::cin >> n;
        for(int i=0;i<n;i++){
                std::cin >> a >> b >> c;
                std::multiset<int> st;
                st.insert(a);
                st.insert(b);
                st.insert(c);
                std::multiset<int>::iterator itr=st.begin();
                a = *itr; a = a*a;itr++;
                b = *itr; b = b*b;itr++;
                c = *itr; c = c*c;itr++;
                if(a+b == c) std::cout << "YES" << std::endl;
                else std::cout << "NO" << std::endl;
        }
        return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
  vector<int> ar;
  int n;
  int d;
  cin >> n;
  for(int i=0;i<n;i++){
    for(int j=0;j<3;j++){
      cin >> d;
      ar.push_back( d );
    }
    sort( ar.begin() , ar.end() , greater<int>() );
    int a = ar[0] * ar[0];
    int b = ar[1] * ar[1];
    int c = ar[2] * ar[2];
    if(a == (b + c)){
      cout << "YES" << endl;
    }else {
      cout << "NO" << endl;
    }
    ar.clear();
  }
}

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  int a,b,c;
  int cnt[10000];
  memset(cnt,0,sizeof(cnt));
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a>>b>>c;
    if(a*a==b*b+c*c||b*b==a*a+c*c||c*c==a*a+b*b){
      cnt[i]=1;
    }
  }
  for(int i=0;i<n;i++){
    if(cnt[i]==1){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return(0);
}

C++: #include <bits/stdc++.h>
#ifdef dbg
#include "./printer.hpp"
#else
#define dump(x) void(0)
#endif

#define MOD 1000000007
using namespace std;
#define ll long long
inline long  toInt(string s) {long  v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

int main(){
  ll n;
  cin >> n;
  for(ll i = 0; i < n; i++){
    ll a,b,c;
    cin >> a >> b >> c;
    ll ma = max(a,b);
    ma = max(ma,c);
    if(a*a + b*b + c*c - ma*ma == ma*ma){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
}

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

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

int main(int argc, char** argv)
{
  int N;

  std::cin >> N;

  int a[3];

  while (N --) {
    std::cin >> a[0] >> a[1] >> a[2];

    std::sort(a + 0, a + 3);

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

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

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

static const int DataMax = 1000;	// Max value of elements

typedef struct _triangle
{
    int count;	// Number of elements
    std::vector<int> vec[DataMax];
} triangle_t;

static void inputData(triangle_t& data, int& num)
{
    int v1, v2, v3;

    if (0x00 == &data) {
        std::cerr << "data is null" << std::endl;
        return;
    }

    std::cin >> num;
    for (int i = 0; i < num; i++) {
        std::cin >> v1 >> v2 >> v3;
        data.vec[data.count].push_back(v1);
        data.vec[data.count].push_back(v2);
	data.vec[data.count].push_back(v3);
        data.count++;
    }
}

static bool isRightTriangle(std::vector<int>& vec)
{
    if (0x00 == &vec) {
        std::cerr << "vec is null" << std::endl;
        return false;
    }

    if ((int)pow((double)vec.at(0), 2.0) + (int)pow((double)vec.at(1), 2.0) == (int)pow((double)vec.at(2), 2.0)) {
        return true;
    } else if((int)pow((double)vec.at(1), 2.0) + (int)pow((double)vec.at(2), 2.0) == (int)pow((double)vec.at(0), 2.0)) {
        return true;
    } else if ((int)pow((double)vec.at(0), 2.0) + (int)pow((double)vec.at(2), 2.0) == (int)pow((double)vec.at(1), 2.0)) {
        return true;
    }

    return false;
}

int main()
{
    triangle_t triangle = {0};
    int num = 0;

    inputData(triangle, num);
    for (int i = 0; i < num; i++) {
        if (true == isRightTriangle(triangle.vec[i])) {
            std::cout << "YES" << std::endl;
        } else {
            std::cout << "NO" << std::endl;
        }
    }

    return 0;
}

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

int main() {
	int N;
	cin >> N;
	vector<int> a(3);
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 3; j++) {
			cin >> a[j];
			a[j] = pow((double)a[j], 2);
		}
		sort(a.begin(), a.end());			
		if (a[0] + a[1] == a[2]) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
		for (int j = 0; j < 3; j++) {
			a[j] = 0;
		}
	}
	return 0;
}