Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	num := int(n)
	var strs []string
	var a, b, c int
	var res string
	var YES string = "YES"
	var NO string = "NO"
	for i := 0; i < num; i++ {
		scanner.Scan()
		strs = strings.Split(scanner.Text(), " ")
		a, _ = strconv.Atoi(strs[0])
		b, _ = strconv.Atoi(strs[1])
		c, _ = strconv.Atoi(strs[2])

		res = NO
		if c*c == (a*a+b*b) || b*b == (a*a+c*c) || a*a == (b*b+c*c) {
			res = YES
		}
		fmt.Printf("%s\n", res)
	}
}

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 && i<N; i++)
        scanf("%d %d %d",&d[i].a[0],&d[i].a[1],&d[i].a[2]);
    L=i;
    for(i=0;i<L;i++){        
        longest=0; small=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>
using std::cin;
using std::cout;
using std::endl ;
int main()
{
	int N,i,j,t;
	int a[1000][3];
	cin>>N;
	for(i=0;i!=N;i++)
	{
		for(j=0;j!=3;j++)
			cin>>a[i][j];
	}
	for(i=0;i!=N;i++)
	{
		for(j=0;j!=2;j++)
			if(a[i][j]>a[i][j+1])
			{	t=a[i][j];a[i][j]=a[i][j+1];a[i][j+1]=t;}
		if(a[i][2]*a[i][2]==a[i][1]*a[i][1]+a[i][0]*a[i][0])
			cout<<"yes"<<endl;
		else
			cout<<"no"<<endl;
	}
	return 0;
}

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

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