Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
)

var (
	sc = bufio.NewScanner(os.Stdin)
)

func main() {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	for i := 0; i < n; i++ {
		sc.Scan()
		edges := make([]int, 3, 3)
		cols := sort.StringSlice(strings.Split(sc.Text(), " "))
		cols.Sort()
		for i, c := range cols {
			edges[i], _ = strconv.Atoi(c)
			edges[i] = int(math.Pow(float64(edges[i]), 2))
		}
		msg := "NO"
		if edges[2] == edges[0]+edges[1] {
			msg = "YES"
		}
		fmt.Println(msg)
	}
}

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

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

#define N 1000

struct{int a[3];} d[N];

int main(){
    int i,j,L;
    int longest,small;
    scanf("%d",&j);
    for(i=0; i<j;scanf("%d %d %d",&d[i].a[0],&d[i].a[1],&d[i].a[2]),i++);
    L=i;
    for(i=0;i<L;i++){        
        longest=0;
        for(j=0;j<3;j++)
            if(longest<d[i].a[j])
                longest=d[i].a[j];
        for(j=0;j<3;j++)
            if(d[i].a[j]!=longest)
                small+=pow(d[i].a[j],2);
        if(small==pow(longest,2))
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main() {
	int x, a, b, c;
	string ans[10000];
	cin >> x;
	for (int i = 1; i <= x; i++) {
		cin >> a >> b >> c;
		a *= a;
		b *= b;
		c *= c;
		if (a + b == c || a + c == b || b + c == a) {
			ans[i] = "YES";
		}
		else {
			ans[i] = "NO";
		}
	}
	for (int i = 1; i <= x; i++) {
		cout << ans[i] << endl;
	}
	return 0;
}

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

int main(){
  int a, b, c, k;
  int i=0;
  scanf("%d", &k);
  while(i<k){
    scanf("%d %d %d", &a, &b, &c);
    i++;
    int max = (int)fmax((double)a, fmax((double)b, (double)c));
    int sum = a*a + b*b + c*c;
    if (sum==2*max*max)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}