Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	li := make([]int, 3)

	sc.Scan()
	N, _ := strconv.Atoi(sc.Text())

	for i := 0; i < N; i++ {
		for j := 0; j < 3; j++ {
			sc.Scan()
			x, _ := strconv.Atoi(sc.Text())
			li[j] = x
		}
		sort.Ints(li)

		switch li[2]*li[2] == li[1]*li[1]+li[0]*li[0] {
		case true:
			fmt.Println("YES")
		case false:
			fmt.Println("NO")
		default:
		}
	}

}

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

using namespace std;

void inputData(vector<string>& data_set, int header = 0) {
	string buffer;

	for(int i = 0; i < header; ++i)
		getline(cin, buffer);

	while(getline(cin, buffer))
		data_set.push_back(buffer);
}

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

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


vector<bool> 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])};

		ret[i] = isRightTriangle(buff);
	}

	return ret;
}


void doAllProcess() {
	vector<string> buffer;

	inputData(buffer, 1);

	vector<bool> ret = evaluateTriangle(buffer);

	for(int i = 0; i < ret.size(); ++i)
		std::cout << (ret[i] ? "YES" : "NO") << std::endl;
}



int main() {
	doAllProcess();

	return 0;
}

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

using namespace std;

int main(void)
{
  int a,b,c,n;
  vector<int> triangle;

  cin >> n;
  
  for(int i=0;i<n;i++){

    cin >> a >> b >> c;
    
    triangle.push_back(a);
    triangle.push_back(b);
    triangle.push_back(c);

    sort(triangle.begin(),triangle.end(),greater<int> () );

    a=triangle[0];
    b=triangle[1];
    c=triangle[2];

    if(a*a==b*b+c*c)
      cout << "YES" << endl;

    else
      cout << "NO" << endl;

    triangle.clear();

  }

  return 0;
  
}

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

int main(){
  int n;
  int* m;
  int list[1000][3];
  cin>>n;
  for(int i=0;i<n;i++){
  cin>>list[i][0]>>list[i][1]>>list[i][2];
  }
  for(int j=0;j<n;j++){
  sort(list[j],list[j]+3);
  if(list[j][0]*list[j][0]+list[j][1]*list[j][1]==list[j][2]*list[j][2]) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
  }
  return 0;
}

C++: #include <stdio.h>

int main(){
	int timel,timei,a,b,c;
	scanf("%d",&timel);
	for(timei=0;timei<timel;timei++){
		scanf("%d %d %d",&a,&b,&c);
		a = a^2;
		b = b^2;
		c = c^2;
		if(a+b==c || b+c==a || c+a==b){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <cmath>
#include<algorithm>
using namespace std;
int main()
{
    int a,b,c,n,i;
    cin>>n;
    for(i=0;i<n;i++){
                if(a*a==b*b+c*c || b*b==a*a+c*c || c*c==b*b+a*a)
            cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
        
    }
        
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		int l[3];
		cin >> l[0] >> l[1] >> l[2];
		sort(l,l+3);
		if(l[2]*l[2] == l[1]*l[1] + l[0]*l[0])
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
      return 0;
}

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

int main(void){
	int x[3];
	string n = "NO", y = "YES";
	while(cin >> x[0] >> x[1] >> x[2]){
		sort(x,x + 3);
		if(x[2] <= x[1] + x[0])
			cout << y << endl;
		else
			cout << n << endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
 
using namespace std;
 
int main(void){
  int n,array[3],i,temp;
 
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d%d%d",&array[0],&array[1],&array[2]);
    sort(array,array+3);
    if(array[0]*array[0]+array[1]*array[1]==array[2]*array[2])  printf("Yes\n");
    else  printf("No\n");
  }
 
  return 0;
}

C++: using System;
using System.Collections.Generic;

namespace TriangleRight
{
	class MainClass
	{
		public static void Main(string[] args) 
		{
			string str; 
			List<string> status = new List<string> ();
			while (!string.IsNullOrEmpty(str = Console.ReadLine())) {
				string[] input = str.Split(' ');
				int a, b, c;
				if (input.Length > 2 && input.Length <= 3) {
					a = input [0].Equals ("") ? 0 : int.Parse (input [0]);
					b = input [1].Equals ("") ? 0 : int.Parse (input [1]);
					c = input [2].Equals ("") ? 0 : int.Parse (input [2]);
				} else {
					a = input [0].Equals ("") ? 0 : int.Parse (input [0]);
					b = 0;
					c = 0;
				}

				if (a + b > c) {
					if (a + c > b) {
						if (b + c > a) {
							status.Add ("YES");
						} else {
							status.Add ("NO");
						}
					} else {
						status.Add ("NO");
					}
				} else {
					status.Add ("NO");
				}
			};

			for (int i = 0; i < status.Count; i++) {
				Console.WriteLine (status[i]);
			}


			Console.Read ();
		}
	}
}

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

int main(){
	int N;
	int i=0;
	int hyp=0,cat=0;
	int x=0;
	
	cin >> N;
	int side[N][3];
	
	while(i<N){
		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++;
			}
		}
	}
	
	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<iostream>
using namespace std;
int main() {
	int N,a,b,c;
	cin >> N;
	for (int i = 1; i <= N; i++) {
		cin >> a >> b >> c;
		if (a*a + b*b == c*c || a*a + c*c == b*b || b*b + c*c == a*a) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
}

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

int main(){
	int n,s=0;
	cin >> n;
	
	while( n>=s ){
		int i=0,k=0,j=0,l=0;
		cin >> i >> k >> j;

		if( i<k ){
			l = i;
			i = k;
			k = l;
		}
		if( i<j ){
			l = i;
			i = j;
			j = l;
		}

		i = i*i;
		j = j*j;
		k = k*k;

		if( i==(j+k) ) cout << "YES" << "\n";
		else cout << "NO" << "\n";
		s++;
	}
}

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