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

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

int check(int a, int b, int c);

int main(){
  int n;
  int a, b, c;
  int longest;
  
  std::cin >> n;
  for(int i=0; i<n; i++){
    std::cin >> a;
    std::cin >> b;
    std::cin >> c;
    
    longest = check(a, b, c);
    switch(longest){
      case 1:
        if(pow((double)a,2.0)==pow((double)b, 2.0)+pow((double)c, 2.0)){
          std::cout << "YES" << std::endl;
        }else{
          std::cout << "NO" << std::endl;
        }
        break;
      case 2:
        if(pow((double)b,2.0)==pow((double)a, 2.0)+pow((double)c, 2.0)){
          std::cout << "YES" << std::endl;
        }else{
          std::cout << "NO" << std::endl;
        }
        break;
      default:
        if(pow((double)c,2.0)==pow((double)a, 2.0)+pow((double)b, 2.0)){
          std::cout << "YES" << std::endl;
        }else{
          std::cout << "NO" << std::endl;
        }
        break;
    }
  }
  
  return 0;
}

int check(int a, int b, int c){
  if(a>b){
    if(a>c) return 1;
    else    return 3;
  }else{
    if(b>c) return 2;
    else    return 3;
  }
}