Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextInt() int {
	scanner.Scan()
	i, e := strconv.Atoi(scanner.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func main() {
	scanner.Split(bufio.ScanWords)
	n := nextInt()
	for i := 0; i < n; i++ {
		a := nextInt()
		b := nextInt()
		c := nextInt()
		if a*a == b*b + c*c || b*b == a*a + c*c || c*c == a*a + b*b {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
		continue
	}
}

C++: /*
AOJ_0003_IsitaRightTriangle?

EOFはWindowsはCtrl+Z,UNIXはCtrl+D

方針
配列入れて昇順ソートして　１番目と２番目の二乗の合計が
三番目の二乗になってるか確かめる。

配列の大きさが３固定なので、multisetに格納するのはもったいない
普通の配列に入れて、sortを使う

*/

#include <iostream>
#include <string>
#include <cstdio>
#include <math.h>
#include <algorithm>

using namespace std;

int main() {
	int N, side[3], i,j;

	cin >> N;

	for (i = 0; i < 3; i++){
		cin >> side[0] >> side[1] >> side[2];
		sort(side, side + 3);

		if (pow(side[0], 2) + pow(side[1], 2) == pow(side[2], 2)){
			cout << "YES" << endl;		
		}
		else {
			cout << "NO" << endl;
		}	
	}
	return 0;
}

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

using namespace std;

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

C++: #include <iostream>

using namespace std;

int main(){
    while(1){
        int N;
        cin>>N;
        if(cin.eof())return 0;

        while(N--){
            int x,y,z;
            cin>>x>>y>>z;
            if((x*x+y*y)==(z*z)||(x*x+z*z)==(y*y)||(y*y+z*z)==(x*x))cout<<"YES\n";
            else cout<<"NO\n";
        }
    }
}

C++: #include<iostream>

int main(){
	int a,b,c;
	std::cin>>a;
	std::cin>>b;
	std::cin>>c;
	if(a*a+b*b==c*c){
		std::cout<<"YES"<<std::endl;
	}else if(a*a+c*c==b*b){
		std::cout<<"YES"<<std::endl;
	}else if(b*b+c*c==a*a){
		std::cout<<"YES"<<std::endl;
	}else{
		std::cout<<"NO"<<std::endl;
	}

	return 0;
}

C++: #include <cstdio>
#include <math.h>

using namespace std;

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

C++: 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include<iostream>
using namespace std;
int main(){
  int a,b,c,i;
  cin >> i; 
  for(int n = 0;n < i;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 == b * b + a * a){
      cout << "YES" << endl;
    } else {cout <<"NO" << endl;} 
  }
}

C++: #include<iostream>
using namespace std;
int main(){
  int a,b,c;
  while(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 == b*b+a*a)
    cout<<"YES"<<endl;
  else
    cout<<"NO"<<endl;
  }
  return 0;
}

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

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

int main()
{
    double a,b,c,d,e,f;
    
    while(cin>>a>>b>>c>>d>>e>>f){
    
        double x=(e*c-b*f)/(e*a-b*d);
        double y=(d*c-a*f)/(d*b-a*e);
    
        printf("%.3f %.3f\n",x,y);
    }
    
    return 0;
    
}

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

int main() {
    string str;
    int n;
    cin >> n;
    vector<int> vx, vy, vz;
    for(int i = 0; i < n; i++) {
        int x, y, z;
        cin >> x >> y >> z;
        vx.push_back(x);
        vy.push_back(y);
        vz.push_back(z);
    }
    
    for(int i = 0; i < n; i++) {
        vector<int> v;
        v.push_back(vx[i]);
        v.push_back(vy[i]);
        v.push_back(vz[i]);

        sort(v.begin(), v.end());
        if(pow(v[2],2.0) == pow(v[0],2.0) + pow(v[1],2.0)){
            str = "YES";
        } else {
            str = "NO";
        }
        cout << str << endl;
    }  
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.tri", "r", stdin);
	string str = "";
	int n;

	getline (cin, str );
	stringstream ssn(str);
	ssn >> n;

	int i;
	int a, b, c;
	vector <int> side(3,0);

	for (i = 0; i < n; ++i){
		getline (cin, str );
		stringstream ss(str);
		ss >> a >> b >> c;
		side[0] = a; side[1] = b; side[2] = c;		
		sort (side.begin(), side.end() );

		if (side[2] < side[0] + side[1] && side[2]*side[2] == side[1]*side[1] + side[0]*side[0]){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		} // end if
	} // end for
		
	return 0;
}

C++: #include <stdio.h>

int main(){

	int N = 0, a=0, b=0, c=0,i;

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

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

int main(){
	int N;
	int i=0;
	int hyp=0,cat=0;
	int x=0;
	
	cout << "How many date sets (N<=1000) N=";
	cin >> N;
	int side[N][3];
	
	while(i<N){
		cout << "please input length : ";
		cin >> side[i][0] >> side[i][1] >> side[i][2];
		if(1<=side[i][0] && side[i][0]<= 1000){
			if(1<=side[i][1] && side[i][1]<= 1000){
				if(1<=side[i][2] && side[i][2]<= 1000)
					i++;
			}
		}
		else
			cout << "error 1<=length<=1000\n";
	}
	
	for(int j=0; j<i; j++){
		for(int k=0; k<3; k++){
			x = side[j][k]*side[j][k];
			if(hyp <= x){
				cat += hyp;
				hyp = x;
			}
			else
				cat += x;
		}
		if(hyp == cat)
			cout << "Yes\n";
		else
			cout << "No\n";
		hyp=0;
		cat=0;
	}
	
	return 0;
}

C++: #include <stdio.h>

enum {YES, NO} y_n;

int tri_judge(int x, int y, int z);
int pow2(int x);

int main(void)
{
    int dataset;
    scanf("%d", &dataset);

    int side1, side2, side3;
    while (dataset--){
        scanf("%d %d %d", &side1, &side2, &side3);
        y_n = tri_judge(side1, side2, side3);
        if (y_n == YES){
            printf("YES\n");
        } else {
            printf("NO\n");
        }

    }

    return 0;
}

int tri_judge(int x, int y, int z)
{
    if (pow2(x) == pow2(y) + pow2(z)){
        y_n = YES;
    } else if (pow2(y) == pow2(z) + pow2(x)){
        y_n = YES;
    } else if (pow2(z) == pow2(x) + pow2(y)){
        y_n = YES;
    } else {
        y_n = NO;
    }

    return y_n;
}

int pow2(int x)
{
    return x * x;
}

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 > b&&a > c) {
			if (a*a == b * b + c * c)
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
		if (b > a&&b > c) {
			if (b*b == a * a + c * c)
				cout << "YES" << endl;
			else
				cout<< "NO" << endl;
		}
		else {
			if (c*c == a * a + b * b)
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
	}
    return 0;
}