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)
		for i, c := range strings.Split(sc.Text(), " ") {
			edges[i], _ = strconv.Atoi(c)
			edges[i] = int(math.Pow(float64(edges[i]), 2))
		}
		sort.IntSlice(edges).Sort()
		msg := "NO"
		if edges[2] == edges[0]+edges[1] {
			msg = "YES"
		}
		fmt.Println(msg)
	}
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include<iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <cstdio>

using namespace std;

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

C++: 

#include<iostream>
using namespace std;

int main(){
	int edge[3];	// ??\????????????
	int max = 0;	// ???????????§???????????????????????????
	int sum = 0;	// ??????????????????
    int num;    // ????????????????????°
	int i,j;
    
    cin >> num; // ????????????????????°??????????????????
	for (j=0; j<num; j++) {
        
        // input 3 edges.
        for( i=0;i<3 ;){
            cin >> edge[i];
            // ?????¶ : 0 <= ???????????? <= 1000
            if(edge[i] < 0  ||  edge[i] > 1000){
                continue;
            }
            i++;
        }
        
        // ?????????????????§????????????
        for(i=1,max=0;i<3;i++){
            if(edge[i] > edge[max]){	max = i;    }
        }
        
        // ??????????????????????±??????????
        for(i=0,sum=0 ;i<3;i++){
            if(i != max){	sum += edge[i] * edge[i];   }
		}
        
        // output
        if(edge[max] * edge[max] == sum){	cout << "YES\n";	}
        else{	cout << "NO\n";	}
	}
    
	return 0;
}

C++: #include<stdio.h>
#include<stdbool.h>

bool right_triangle(int x, int y, int z); 

int main(void)
{
    int n, a, b, c;
    scanf("%d",&n);
    for(int i = 0; i < n; i++){
        scanf(%d %d %d, &a, &b, &c);
        if(right_triangle(a, b, c)){
            printf("YES\n");
        }else{
            printf("NO/n");
        }
    return 0;
}

bool right_triangle(int x, int y, int z)
{
    if(x*x + y*y = z*z || x*x +  z*z = y*y || z*z+ y*y = x*x ){
        return true;
    }
    return false;
}

C++: #include<algorithm>
#include<functional>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

typedef unsigned long long ull;
typedef long long ll;

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

using namespace std;

typedef pair<int ,int > P;

int n;

int main()
{
	cin>>n;
	rep(i,n)
	{
		vector<int> vec;
		int a,b,c;
		cin>>a>>b>>c;
		vec.pb(a);
		vec.pb(b);
		vec.pb(c);
		sort(all(vec));

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


	}
	


	return 0;
}

C++: #include<iostream>
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 ^ 2 == b ^ 2 + c ^ 2 || b ^ 2 == a ^ 2 + c ^ 2 || c ^ 2 == a ^ 2 + b ^ 2) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: 
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
	int n,a,b,c,a1,b2,c2;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a>>b>>c;
		a1=pow(a,2);
		b2=pow(b,2);
		c2=pow(c,2);
		if(a1+b2==c2)
			cout<<"YES"<<endl;
		if(a1+c2==b2)
			cout<<"YES"<<endl;
		if(a1+c2==b2)
			cout<<"YES"<<endl;
		if(a1+b2!=c2&&a1+c2!=b2&&a1+c2!=b2)
			cout<<"NO"<<endl;
	}
				
	return 0;
}

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

#define SQ(x) ((x)*(x))

using namespace std;

int a[3];

int main()
{
  int n;
  scanf("%d", &n);
  while(n--){
    for(int i=0;i<3;i++)
      scanf("%d", a+i);

    sort(a, a+3);
    puts(SQ(a[0])+SQ(a[1]) == SQ(a[2])?"YES":"NO");
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
 
#define MAX 1000
#define MIN 1
 
using namespace std;
 
int main() {
 int i = 0,j;
 int n;
 int side[3];
 bool cnt;
 vector<string> judge;
 
 cin >> n;
 
 while(i < n) {
  cnt = false;

  cin >> side[0] >> side[1] >> side[2];
 
  for(j = 0;j < 3;++j) {
   if((side[j] < MIN) || (side[j] > MAX)) {
    cnt = true;
   }
  }
 
  if(cnt == true) continue; 
 
  sort(side, side + 3);
 
  if(((side[0] % 3) == 0) && ((side[1] % 4) == 0) && ((side[2] % 5) == 0)) {
   judge.push_back("YES");
  } else {
   judge.push_back("NO");
  }

  ++i;
 }
 
 for(i = 0;i < judge.size();++i) {
  cout << judge.at(i) << endl;
 }
 
 return 0;
}

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

int main(){
	int a[3];
	for(int i = 0; i < 3; i++){
	cin >> a[i] ;
	}

	sort(a, a+3);
	if(a[2]*a[2] == a[0]*a[0] + a[1]*a[1]) cout << "YES" << endl;
	else cout << "NO" << endl;

	return 0;
}

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



int main(void){

	int n,i;
	double x[1000], y[1000], z[1000], a[1000],aa[1000],aaa,xa[1000],ya[1000],za[1000];

	a[0] = 3;
	
	double tmp;

	std::cin >> n;
	i = 0;

	for (i = 0; i < n; i++) {
		

		

		std::cin >> x[i];
		std::cin >> y[i];
		std::cin >> z[i];


		if(x[i] < y[i]){

			tmp = y[i];
			y[i] = x[i];
			x[i] = tmp;
			

		}
		if(y[i] < z[i]){

			tmp = z[i];
			z[i] = y[i];
			y[i] = tmp;
			

		}if(x[i] < y[i]){

			tmp = y[i];
			y[i] = x[i];
			x[i] = tmp;
			

		}
		if(y[i] < z[i]){

			tmp = z[i];
			z[i] = y[i];
			y[i] = tmp;
			

		}
		
		
		
		
		ya[i] = y[i] * y[i];
		xa[i] = x[i] * x[i];
		za[i] = z[i] * z[i];
		aaa = ya[i] + za[i];

		if (aaa == xa[i]) aa[i] = 1;
		else aa[i] = 0;	

		

		



	}

	

	for (i = 0; i < n; i++) {

		if(aa[i] == 0)printf("NO\n");
		if(aa[i] == 1)printf("YES\n");

		


	}



	return 0;





}

C++: #include <stdio.h>
#include <stdlib.h>

int cmpint(const void *a, const void *b){
	return (*(int*)b - *(int*)a);
}

int main(void){
	int len = 0;
	scanf("%d", &len);
	int a[3];
	for(int i=0; i<len;++i){
		scanf("%d %d %d", a, a+1, a+2);
		qsort(a, 3, sizeof(int), cmpint);
		if(a[0]*a[0] == (a[1]*a[1] + a[2]*a[2])){
			puts("YES");
		}else{
			puts("NO");
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <boost/array.hpp>

int main()
{
	int N;
	std::cin >> N;
	for (int i = 0; i < N; ++i) {
		boost::array<int, 3> sides;
		std::cin >> sides[0] >> sides[1] >> sides[2];
		std::sort(sides.begin(), sides.end());
		std::cout << (sides[0] * sides[0] + sides[1] * sides[1] == sides[2] * sides[2] ?
				"YES" : "NO") << std::endl;
	}
	return 0;
}

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

#include <cstdlib>
#include <iostream>

namespace {

bool is_traiangle(int a, int b, int c) {
    int a1, b1, c1;
    if (a >= b && a >> c) {
        a1 = a;
        b1 = b;
        c1 = c;
    } else if (b >= a && b >= c) {
        a1 = b;
        b1 = a;
        c1 = c;
    } else {
        a1 = c;
        b1 = a;
        c1 = b;
    }
    return (a1 < b1 + c1) && (a1 * a1 == b1 * b1 + c1 * c1);
}

}


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