Go: package main

import "fmt"

func main() {
	var n int

	fmt.Scanf("%d", &n)

	var a, b, c int
	for i := 0; i < n; i++ {
		var isTriangle bool
		fmt.Scanf("%d %d %d", &a, &b, &c)

		if a*a == b*b+c*c || b*b == a*a+c*c || c*c == b*b+a*a {
			isTriangle = true
		}

		if isTriangle == true {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

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

int main(){
	int N;
	double a,b,c,X;
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>a>>b>>c;
		if(a>b){
			X=a;
			a=b;
			b=X;
		}
		if(a>c){
			X=a;
			a=c;
			c=X;
		}
		if(b>c){
			X=b;
			b=c;
			c=X;
		}
		if(sqrt(a*a+b*b)==c){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
		//cout<<a<<b<<c;
	}
    return 0;
}