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(){
    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;
}

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

int main(void){
  int a[10],b[10],c[10],i,j;
  scanf("%d",&i);
  for(j=0;j<i;j++){
    scanf("%d %d %d",&a[j],&b[j],&c[j]);
  }
  for(j=0;j<i;j++){
    if((a[j]*a[j]+ b[j]*b[j] == c[j]*c[j])||(a[j]*a[j] + c[j]*c[j] == b[j]*b[j])||(b[j]*b[j]+c[j]*c[j] ==a[j]*a[j])){
      printf("%d %d %d\n",a[j],b[j],c[j]);
      printf("YES\n");
    }
    else
      printf("NO\n");
  }
  return 0;
}