Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	// sc.Split(bufio.ScanLines)
	sc.Split(bufio.ScanWords)
	n, _ := strconv.Atoi(read())
	s := make([]int, 3)
	for i := 0; i < n; i++ {
		s[0], _ = strconv.Atoi(read())
		s[1], _ = strconv.Atoi(read())
		s[2], _ = strconv.Atoi(read())
		sort.Sort(sort.IntSlice(s))
		if (s[2] * s[2]) == ((s[0] * s[0]) + (s[1] * s[1])) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

using namespace std;

int main()
{
        int n;
        int len[3];

        scanf("%d", &n);
        for (int i = 0; i < n; i++) {
                for (int i = 0; i < 3; i++) {
                        scanf("%d", &len[i]);
                }
                for (int i = 0; i < 2; i++) {
                        if (len[i] > len[i + 1]) {
                                int tmp = len[i];
                                len[i] = len[i + 1];
                                len[i + 1] = tmp;
                        }
                }
                string ans = ((len[0] * len[0] + len[1] * len[1]) == len[2] * len[2])
                                   ? "YES" : "NO";
                printf("%s\n", ans.c_str());
        }

        return 0;
}

C++: #include <iostream>

bool isTriangle(int a, int b, int c){
	if(a*a == b*b + c*c || b*b == a*a + c*c || c*c == a*a + b*b)	return true;
	else return false;
}

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

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

bool is_a_right_triangle(int a, int b, int c) {
        int a2 = a*a;
        int b2 = b*b;
        int c2 = c*c;

        if (a2 + b2 == c2) {
                return true;
        }

        if (a2 + c2 == b2) {
                return true;
        }

        if (b2 + c2 == a2) {
                return true;
        }

        return false;
}

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

        cin >> n;
        while(n--) {
                cin >> a >> b >> c;
                if (is_a_right_triangle(a,b,c)) {
                        cout << "YES" << endl;
                } else {
                        cout << "NO" << endl;
                }
        }

        return 0;
}

C++: #include <iostream>
 
int main()
{
    int x, a, b, c; // put space after ","
    std::cin >> x;
    for (int i = 0; i < x;i++) { // put space after ";" and after ")"
        std::cin >> a >> b >> c;
        if ( a * a + b * b == c * c || b * b + c * c == a * a || c * c + a * a == b * b) {
            std::cout << "YES" << std::endl;
        } else {              // indent is like this;this "}" ends "if () {" structure.
                              // put space at both sides of "else"
            std::cout << "NO" << std::endl;
        } // indent is like this; this "}" ends "else {" structure
    } // indent is like this.
    return 0;
}

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

int main(){
	long n;
	cin >> n;
	for (long i = 0; i < n; i++){
		vector<long> edge(3);
		cin >> edge[0] >> edge[1] >> edge[2];
		sort(edge.begin(), edge.end());
		if (edge[0] * edge[0] + edge[1] * edge[1] == edge[2] * edge[2]){
			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 i;

	while(true){
	// input 3 edges.
	for( i=0; i < 3 ; ){
		if( !(cin >> edge[i]) )	return 0;	// ??\???????¶????????????£?????????????????´??????
		// ?????¶ : 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 <iostream>
#include <algorithm>
using namespace std;

int main() {
    
    int length[3];
    int a,b,c;
    
    while(cin >> length[0] >> length[1] >> length[2]) {
        sort(length,length + 3,greater<int>());
        a = length[2] * length[2];
        b = length[1] * length[1];
        c = length[0] * length[0];
        
        if(a + b == c)cout << "YES" << endl;
        else cout<< "NO" << endl;
    }
    return 0;
}

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

using namespace std;

int main()
{
  int a[3];
  int n;

  while(cin>>n){
    while(n--){
      for(int i = 0; i < 3; ++i){ cin >> a[i]; a[i] *= a[i];}
      sort(a, a+3);

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


  return 0;
}

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

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0003&lang=jp

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

C++: #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int compute(int x) {return x*x;}
int main() {
  int num=0;
  cin>>num;
  for(int i=0;i<num;i++) {
    vector<int> triangle;
    int a,b,c;
    cin>>a>>b>>c;
    triangle.push_back(a);
    triangle.push_back(b);
    triangle.push_back(c);
    sort(triangle.begin(),triangle.end());
    if(compute(triangle[2])==(compute(triangle[0])+compute(triangle[1]))) 
      cout<<"YES";
    else
      cout<<"NO";
    cout<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>

#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

int main(void){
    
    int number;
    int hen[3];
    int temp;
    cin >> number;
    bool judge[200];
    
    REP(i,number)
    {
        REP(i, 3)
        cin >> hen[i];
        REP(i, 2)
        REP(j, 2)
        {
            if(hen[j] < hen[j+1])
            {
                temp = hen[j+1];
                hen[j+1] = hen[j];
                hen[j] = temp;
            }
        }
        if(hen[0]*hen[0] == (hen[1]*hen[1] + hen[2]*hen[2]))
            judge[i] = true;
        else
            judge[i] = false;
        
    }
    REP(i, number)
    {
        if(judge[i])
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
  
    
    return 0;
}

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

using namespace std;

int main(){
	
	int N;
	vector<int> a(3);
	
	cin>>N;
	
	while(N>0){
		for(int i=0;i<3;i++)
			cin>>a[i];
		sort(a.begin(),a.end());
		if(pow(a[2],2.0)==pow(a[1],2.0)+pow(a[0],2.0))
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
		N--;
	}
	
		
	}

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

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