Go: package main

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

func sliceAtof64(sa []string) ([]float64, error) {
	si := make([]float64, 0, len(sa))
	for _, a := range sa {
		i, err := strconv.ParseFloat(a, 64)
		if err != nil {
			return si, err
		}
		si = append(si, i)
	}
	return si, nil
}

func answer(ans bool) {
	if ans {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
func isRightTriangle(ary []float64) (ans bool) {
	sort.Sort(sort.Reverse(sort.Float64Slice(ary)))
	ans = math.Pow(ary[1], 2.0)+math.Pow(ary[2], 2.0) == math.Pow(ary[0], 2.0)

	return
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	lineCount, _ := strconv.Atoi(scanner.Text())
	lines := make([]string, lineCount)

	for i := 0; i < lineCount; i++ {
		scanner.Scan()
		lines[i] = scanner.Text()
	}

	for _, v := range lines {
		ary, _ := sliceAtof64(strings.Split(v, " "))
		answer(isRightTriangle(ary))
	}
}

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

int main(int argc, char** argv)
{
    int num;

    cin >> num;
    for (int i = 0; i < num; i++) {
        vector<int> v = vector<int>(3);
        cin >> v[0] >> v[1] >> v[2];
        sort(v.begin(), v.end());
        if (v[0] * v[0] + v[1] * v[1] == v[2] * v[2]) {
            cout << "YES\n";
        } else {
            cout << "NO\n";
        }
    }
    return 0;
}

C++: // Define
#define     ERROR_NUMBER     -1


// Prototype

// 順列検索関数 (find_min_number)
// n個の整数列 inputnumbers の中で一番小さい数字からk番目の整数を返します
// const int *inputnumbers, const unsigned int n, const unsigned int k
int find_min_number(const int *inputnumbers,const unsigned int n,const unsigned int k);

// 順列検索関数 (find_min_number)
// n個の整数列 inputnumbers の中で一番大きい数字からk番目の整数を返します
// const int *inputnumbers, const unsigned int n, const unsigned int k
int find_max_number(const int *inputnumbers,const unsigned int n,const unsigned int k);



// IncludingHeaderFile
#include<iostream>
#include<vector>


// UsingNamespace
using namespace std;


// Functions

// 順列検索関数 (find_min_number)
// n個の整数列 inputnumbers の中で一番小さい数字からk番目の整数を返します
// const int *inputnumbers, const unsigned int n, const unsigned int k
int find_min_number(const int *inputnumbers,const unsigned int n,const unsigned int k){
	int i,j;
	bool flag;
	vector <int> numbers;

	// 引数の誤りをチェック
	if((n < k) || (n <= 0) || (k <= 0)){
		return ((int)ERROR_NUMBER);
	}

	// inputnumbers -> numbers (コピー)
	for(i=0;i < ((int)n);i++){
		numbers.push_back(*(inputnumbers + i));
	}

	// 並び替えのループ
	do{
		flag = false;
		for(i=0;i < (((int)n) - 1);i++){
			if(numbers[i] > numbers[i+1]){
				j = numbers[i];
				numbers[i] = numbers[i+1];
				numbers[i+1] = j;
				flag = true;
			}
		}
	}while(flag == true);

	// 小さいほうからk番目の整数を返す
	return numbers[(k - 1)];
}

// 順列検索関数 (find_min_number)
// n個の整数列 inputnumbers の中で一番大きい数字からk番目の整数を返します
// const int *inputnumbers, const unsigned int n, const unsigned int k
int find_max_number(const int *inputnumbers,const unsigned int n,const unsigned int k){
	int i,j;
	bool flag;
	vector <int> numbers;

	// 引数の誤りをチェック
	if((n < k) || (n <= 0) || (k <= 0)){
		return ((int)ERROR_NUMBER);
	}

	// inputnumbers -> numbers (コピー)
	for(i=0;i < ((int)n);i++){
		numbers.push_back(*(inputnumbers + i));
	}

	// 並び替えのループ
	do{
		flag = false;
		for(i=0;i < (((int)n) - 1);i++){
			if(numbers[i] < numbers[i+1]){
				j = numbers[i];
				numbers[i] = numbers[i+1];
				numbers[i+1] = j;
				flag = true;
			}
		}
	}while(flag == true);

	// 大きいほうからk番目の整数を返す
	return numbers[(k - 1)];
}




#define     MAX_NUMBER     1000
#define     MIN_LENGTH     1
#define     MAX_LENGTH     1000

int main(){
	int n,i;
	int num[3];
	int p,q,r;												// p <= q <= r

	// データ数の入力
	cin >> n;
	if((n <= 0) || (n > ((int)MAX_NUMBER))){
		cerr << "Error : The number is wrong." << endl;
		return -1;
	}

	// データの入力・チェック・並び替え・出力
	for(i=0;i<n;i++){
		// データの入力
		cin >> num[0] >> num[1] >> num[2];
		// データのチェック
		if((num[0] < ((int)MIN_LENGTH)) || (num[0] > ((int)MAX_LENGTH))){
			cerr << "Error : The first number is wrong." << endl;
			return -1;
		}else if((num[1] < ((int)MIN_LENGTH)) || (num[1] > ((int)MAX_LENGTH))){
			cerr << "Error : The first number is wrong." << endl;
			return -1;
		}else if((num[2] < ((int)MIN_LENGTH)) || (num[2] > ((int)MAX_LENGTH))){
			cerr << "Error : The first number is wrong." << endl;
			return -1;
		}
		// データの並び替え
		p = find_min_number(num,3,1);
		q = find_min_number(num,3,2);
		r = find_min_number(num,3,3);
		// 出力
		if(((p * p) + (q * q)) == (r * r)){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}

	return 0;
}

C++: //	??´?§?????§???¢ 
#include<iostream>
using namespace std;

int main() {
	int a,b,c,n;
	cin >> n;
	for ( int i=0; i < n; i++ ){
		bool flag = false;
		cin >> a >> b >> c;
		if (a + b > c && a + c > b && b + c > a){
			if ( ((a*a + b*b) == c*c) ||  ((a*a + c*c) == b*b) || ((b*b + c*c) == a*a) ){
				flag = true;
			}
		}
		if (flag) {
			cout << "yes" << endl;
		}else {
			cout << "no" << endl;
		}
	}
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
int main(){
	int N;
	int count=0;
	int a[3];
	scanf("%d ",&N);
	while(count!=N){
	for(int i=0;i<3;i++){
		scanf("%d ",&a[i]);
	}
	sort(a,a+3);
	if(a[2]<(a[0]+a[1])){
		printf("YES");
		count++;
	}
	else{
		printf("NO");
		count++;
	}
	}
	return 0;
	}

C++: #include<stdio.h>
int main(void)
{
	int n,a,b,c,i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %d %d",&a,&b,&c);
		if(a>b&&a>c){
			if(b*b+c*c==a*a){
				printf("YES\n");
			}
			else{
				printf("NO\n");
			}
		}
		if(b>a&&b>c){
			if(a*a+c*c==b*b){
				printf("YES\n");
			}
			else{
				printf("NO\n");
			}
		}
		if(c>a&&c>b){
			if(a*a+b*b==c*c){
				printf("YES\n");
			}
			else{
				printf("NO\n");
			}
		}
		if(a==b&&a==c){
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include <iostream>
bool Check(int length[3]);

int main(void)
{
    int dataCount;
    std::cin >> dataCount;
    while(dataCount--){
        int length[3];
        std::cin >> length[0] >> length[1] >> length[2];
        std::cout << (Check(length) ? "YES" : "NO") << std::endl;
    }
    return 0;
}

bool Check(int length[3])
{
    int z = length[0] > length[1] ? (length[0] > length[2] ? 0 : 2) : (length[1] > length[2] ? 1 : 2);
    int buffer = 0;
    for(int i=0;i < 3;++i){
        if(i != z){
            buffer += length[i] * length[i];
        }
    }
    return buffer == length[z] * length[z];
}

C++: #include <iostream>
using namespace std;
int main(){
	int a,b,c,N;
	cin>>N;
	for(int i=1;i<=N; i++){
		cin>>a>>b>>c;
		if(a*a+b*b==c*c){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
	}

}

C++: #include<stdio.h>
int main(void)
{
	int N=0;
	int a=0,b=0,c=0;
	int soto=0;
	int i=0;
	scanf("%d",&N);
	for (i=1;i<=N;i++)
	{
		scanf("%d %d %d",&a,&b,&c);
		if (a<b)
		{
			soto=a;
			a=b;
			b=soto;
		}
		if (a<c)
		{
			soto=a;
			a=c;
			c=soto;
		}
		if (a*a==b*b+c*c)
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}

	return 0;
}

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

bool check_right_tri(int a,int b,int c){

  int max = std::max({a,b,c});

  if(max == a && a*a == b*b + c*c)
    return true;
  else if(max == b && b*b == a*a + c*c)
    return true;
  else if(max ==c && c*c == a*a + b*b)
    return true;
  else return false;
}

int main(){
  const int min = 1;
  const int max = 1000;
  const int data_max = 1000;
  int a,b,c,N;
  std::cin >> N;

  for(int i = 0; i < N; ++i){
    std::cin >> a >> b >> c;
    if(check_right_tri(a,b,c))
      std::cout << "YES" << std::endl;
    else
      std::cout << "NO" << std::endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int dd(int x){
	int y;
	y = x * x;
	return y;
}
int main(){
	int n;
	int a, b ,c;
	cin >> n;
	while(n > 0){
		cin >> a;
		cin >> b;
		cin >> c;
		if((dd(a) + dd(b) == dd(c)) || (dd(b) + dd(c) == dd(a)) || (dd(c) + dd(a) == dd(b))){
			cout << "YES\n";
		}else{
			cout << "NO\n";
		}
		n--;
	}
}