Go: package main

import (
  "fmt"
)


func main() {
  var a int
  var b int
  var c int
  var n int
  fmt.Scan(&n)
  for _, err := fmt.Scan(&a, &b, &c); err == nil; _, err = fmt.Scan(&a, &b, &c) {
    if a*a == b*b+c*c {
      fmt.Println("YES")
    } else if b*b == c*c+a*a {
      fmt.Println("YES")
    } else if c*c == a*a+b*b {
      fmt.Println("YES")
    } else {
      fmt.Println("NO")
    }
  }
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <complex>
#include <cmath>
#include <algorithm>
#include <map>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
int main(){
	int num,x,y,z;
	vector<int> tmp1,tmp2,tmp3;
	cin>>num;
	for(int i=0;i<num;i++){
		cin>>x>>y>>z;
		tmp1.push_back(x);
		tmp2.push_back(y);
		tmp3.push_back(z);
	}
	for(int i=0;i<num;i++){
		tmp1[i]*=tmp1[i];
		tmp2[i]*=tmp2[i];
		tmp3[i]*=tmp3[i];
		int high=max(tmp1[i],max(tmp2[i],tmp3[i]));
		int sum=tmp1[i]+tmp2[i]+tmp3[i];
		if(high==sum/2) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
}

C++: /*
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0003
 */
#include <cmath>
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>

using namespace std;

int
main()
{
	string line;
	while (getline(cin, line)) {
		vector<int> sides(3);
		istringstream iss(line);
		for ( int i = 0; i < 3; i++ ) iss >> sides[i];
		sort( sides.begin(), sides.end() );
		int test = pow( sides[0], 2 ) + pow( sides[1], 2 ) - pow( sides[2], 2 );
		cout << ( test == 0 ? "YES" : "NO" ) << endl;
	}
}

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

int main(){
  int N, side1, side2, side3, i;

  scanf("%d", &N);

  for(i = 0; i < N; i++){
    scanf("%d %d %d", &side1, &side2, &side3);
    if(side1 >= side2 && side1 >= side3){
      if(side1 * side1 == side2 * side2 + side3 * side3){
	printf("YES\n");
      }else{
	printf("NO\n");
      }
    }else if(side2 >= side1 && side2 >= side3){
      if(side2 * side2 == side1 * side1 + side3 * side3){
	printf("YES\n");
      }else{
	printf("NO\n");
      }
    }else{
      if(side3 * side3 == side2 * side2 + side1 * side1){
	printf("YES\n");
      }else{
	printf("NO\n");
      }
    }

  }

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    int a,b,c,n;
    cin >> n;
    for (;0<n;n--){
        cin >> a >> b >> c;
        if (a*a+b*b == c*c)
            cout << "YES" << endl;
        else if (a*a+c*c == b*b)
            cout << "YES" << endl;
        else if (b*b+c*c == a*a)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <sstream>

using namespace std;


vector<string> splitString(const string& str, const string& separator = " ") {
	vector<string> ret;

	std::size_t bp, ep;
	bp = ep = 0;
	while((ep = str.find_first_of(separator, bp)) != string::npos){
		if(bp != ep){
			ret.push_back(string(str.begin() + bp, str.begin() + ep));
		}
		bp = ep + 1;
	}

	if(bp <= str.size() - 1){
		ret.push_back(string(str.begin() + bp, str.end()));
	}

	return ret;
}

template <class T>
T convertStringToNumber(const string& str) {
	stringstream ss;
	T ret;

	ss << str;
	ss >> ret;

	return ret;
}


void inputData(vector<string>& data_set) {
	string buffer;

	getline(cin, buffer);
	int n = convertStringToNumber<int>(buffer);

	for(int i = 0; i < n; ++i) {
		getline(cin, buffer);
		data_set.push_back(buffer);
	}
}

bool isRightTriangle(const vector<int>& edge_set) {
	int max_index = 0;

	if(edge_set[max_index] < edge_set[(max_index+1)%3])
		max_index = (max_index+1)%3; 
	if(edge_set[max_index] < edge_set[(max_index+2)%3])
		max_index = (max_index+2)%3; 

	return ((edge_set[max_index] * edge_set[max_index]) ==
				(edge_set[(max_index+1)%3] * edge_set[(max_index+1)%3]
				+ edge_set[(max_index+2)%3] * edge_set[(max_index+2)%3]));
}


void evaluateTriangle(const vector<string>& data_str) {
	vector<bool> ret(data_str.size());

	for(int i = 0; i < data_str.size(); ++i) {
		auto temp = splitString(data_str[i]);
		vector<int> buff { convertStringToNumber<int>(temp[0]),
							convertStringToNumber<int>(temp[1]),
							convertStringToNumber<int>(temp[2])};

		std::cout << (isRightTriangle(buff) ? "YES" : "NO") << std::endl;
	}
}


void doAllProcess() {
	vector<string> buffer;

	inputData(buffer);

	evaluateTriangle(buffer);
}



int main() {
	doAllProcess();

	return 0;
}

C++: #include <stdio.h>

void right_triangle_check(int a, int b, int c);

int main(void)
{
	int set, x, y, z;
	scanf("%d", &set);
	for (int i = 0; i < set; i++) {
		scanf("%d %d %d", &x, &y, &z);
		right_triangle_check(x ,y ,z);
	}
	return 0;
}

void right_triangle_check(int a, int b, int c)
{
	if (a * a + b * b == c * c) {
		printf("YES\n");
	} else if (b * b + c * c == a * a) {
		printf("YES\n");
	} else if (c * c + a * a == b * b) {
		printf("YES\n");
	} else {
		printf("NO\n");
		}
}

C++: #include<iostream>
#include<cmath>
#include<string>
#include<cctype>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
        int n;
        scanf("%d",&n);
        for(int i=0;i<n;i++){
                vector<int>ar(3);
                for(auto&e:ar){
                        scanf("%d",&e);
                }
                sort(ar.begin(),ar.end());
                if(((ar[0]*ar[0])+(ar[1]*ar[1]))==(ar[2]*ar[2])){
                        printf("YES\n");
                }else{
                        printf("NO\n");
                }
        }
        return 0;
}

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

inline bool isTriangle(int edge[]){
    return edge[2]<edge[0]+edge[1]?true:false;
}

int main(void){
    int edge[3];
    int n;
    std::cin>>n;
    for(int i=0;i<n;i++){
        std::cin>>edge[0]>>edge[1]>>edge[2];
        std::sotr(edge,edge+3);
        std::cout<<(isTriangle(edge)?"YES":"NO")<<std::endl;
    }
    return 0;
}

C++: #include <math.h>
#include <iostream>
using namespace std;
int main(){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
    double a,b,c;
    cin >> a >> b >> c;
    if(pow(a,2.0)+pow(b,2.0)==pow(c,2.0)||
            pow(c,2.0)+pow(b,2.0)==pow(a,2.0)||pow(a,2.0)+pow(c,2.0)==pow(b,2.0)){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
}

C++: #include<iostream>
using namespace std;
bool check(int a, int b, int c){
  if( ( a*a + b*b ) == c*c ) return true;
  else return false;
}

int main()
{
  int n,a,b,c;
  cin >> n;
  for(int i=0; i<n; i++){
    cin >> a >> b >> c;
    if(check(a,b,c) ||check(b,c,a) ||check(c,a,b))
      cout << "YES" << endl;
    else cout << "NO" << endl;
  }
}

C++: (function(undefined){
	'use strict';
	(function init() {
		this.output = function() {
			console.log.apply( console, arguments );
		};
		this.stdin = process.openStdin();
		stdin.setEncoding('utf8');
		this.input_list = [];
		stdin.on('data', function(chunk){
			var result = chunk.match(/\d+/g);
			input_list = input_list.concat(result);
		});
		this.input_number = function() {
			return parseInt( input_list.splice(0,1)[0] );
		};
	}).call( this );
	(function solver(){
		function sq(x) {
			return x * x;
		}
		function check(v) {
			return sq(v.a)+sq(v.b)===sq(v.c)
			|| sq(v.b)+sq(v.c)===sq(v.a)
			|| sq(v.c)+sq(v.a)===sq(v.b);
		}
		setTimeout( function solve() {
			var n = input_number();
			var vertexes = [];
			while ( n -- )
				vertexes.push({
					a: input_number(),
					b: input_number(),
					c: input_number()
				});
			vertexes.forEach(function(vertex){
				output( check(vertex) ? 'YES' : 'NO' );
			});
		}, 0 );
	})();
}).call(global);