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)
		for i, c := range strings.Split(sc.Text(), " ") {
			edges[i], _ = strconv.Atoi(c)
			edges[i] = int(math.Pow(float64(edges[i]), 2))
		}
		sort.IntSlice(edges).Sort()
		msg := "NO"
		if edges[2] == edges[0]+edges[1] {
			msg = "YES"
		}
		fmt.Println(msg)
	}
}

C++: #include <iostream>
#define NMAX (1000)
using namespace std;
int main(void){
    
    int N = 0;
    int a=0;
    int b=0;
    int c=0;
    char* Result[NMAX];

    //N??°?????\???
    scanf("%d",&N);
    
    //N?????°???????????????a,b,c???????????????
    for(int Ncount = 0; Ncount < N; Ncount++){
        scanf("%d %d %d",&a,&b,&c);
        
        if( (( (a^2) + (b^2) ) == (c^2)) || (( (b^2) + (c^2) ) == (a^2)) || (( (c^2) + (b^2) ) == (a^2))){
            Result[Ncount] = "Yes";
        }else{
            Result[Ncount] = "NO";
        }
    }
    
    //??????????????????????????¨???Yes or No?????????
    for(int Ncount=0;Ncount < N;Ncount++){
        printf("%s\n",Result[Ncount]);
    }
    
}

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

int main(){
  int n, a, b, c;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a >> b >> c;
    if(a > c) swap(a, c);
    if(b > c) swap(b, c);
    if(a * a + b * b == c * c)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<algorithm>
#include<cstdio>

int main(){
	int n, a[3];
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		for(int j = 0; j != 3; ++j )
			scanf("%d", a+j);
		std::sort(a, a + 3);
		puts(a[2] * a[2] == a[0] * a[0] + a[1] * a[1] ? "YES" : "NO");
	}
	return 0;
}

C++: #include <iostream>

int main()
{
        int a[3], n, t;
        std::cin >> n;
        for(int i = 0; i < n; ++i)
        {
                std::cin >> a[0] >> a[1] >> a[2];
                int max_index=0;
                for(int j = 1; j < 3; ++j)
                        if(a[max_index] < a[j])
                                max_index = j;
                t = 0;
                for(int j = 0; j < 3; ++j)
                        if(j != max_index)
                                t += a[j]*a[j];
                if(t == (a[max_index]*a[max_index]))
                        std::cout << "YES" << std::endl;
                else
                        std::cout << "NO" << std::endl;
        }
        return 0;
}

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

using namespace std;

int main(){
	int n;
	int a,b,c;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a >> b >> c;
		vector<int> v;
		v.push_back(a);
		v.push_back(b);
		v.push_back(c);
		sort(v.begin(),v.end());
		if(v[2]*v[2]==v[1]*v[1] + v[0]*v[0]){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#define NMAX (1000)
using namespace std;
int main(void){
    
    int N = 0;
    int a=0;
    int b=0;
    int c=0;
    char* Result[NMAX];

    //N??°?????\???
    scanf("%d",&N);
    
    //N?????°???????????????a,b,c???????????????
    for(int Ncount = 0; Ncount < N; Ncount++){
        scanf("%d %d %d",&a,&b,&c);
        
        if( (( (a^2) + (b^2) ) == (c^2)) || (( (b^2) + (c^2) ) == (a^2)) || (( (c^2) + (a^2) ) == (b^2))){
            Result[Ncount] = "YES";
        }else{
            Result[Ncount] = "NO";
        }
    }
    
    //??????????????????????????¨???Yes or No?????????
    for(int Ncount=0;Ncount < N;Ncount++){
        printf("%s\n",Result[Ncount]);
    }
    
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
int main() {
	std::vector<int> on ,tw ,th;
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++) {
		int a, b, c;
		std::cin >> a >> b >> c;
		on.emplace_back(a);
		tw.emplace_back(b);
		th.emplace_back(c);
	}
	for (int i = 0; i < n; i++) {
		int x[3];
		x[0] = on[i];
		x[1] = tw[i];
		x[2] = th[i];
		std::sort(x, x + 3);
		if (x[0]* x[0] + x[1] * x[1] == x[2] * x[2]) {
			std::cout << "Yes" << std::endl;
		}
		else {
			std::cout << "No" << std::endl;
		}
	}
}

C++: #include <cstdio>
#include <cstdlib>

using namespace std;

int main()
{
    int n;

    int a;
    int b;
    int c;
    scanf("%d", &n);
    while(n--)
    {
        scanf("%d %d %d", &a, &b, &c);
        if (    (a*a+b*b == c*c) || (b*b+c*c == a*a) || (c*c+a*a == b*b)    )
        {
            printf("YES\n");
        }
        else
        {
            printf("NO\n");
        }
    }
    return 0;
}

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

int main(){
    int n;
    cin >> n;
    int a,b,c;
    while(cin >> a >> b >> c){
        //cout << a << b << c << endl;
        if(pow(a,2.0)==pow(b,2.0)*pow(c,2.0) || pow(a,2.0)==pow(b,2.0)*pow(c,2.0) || pow(a,2.0)==pow(b,2.0)*pow(c,2.0)){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}

C++: #include<iostream>

#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

void solver() {
    int N;
    cin >> N;
    REP(i, 3) {
        int a, b, c;
        cin >> a >> b >> c;
        bool isTri = a * a == b * b + c * c || b * b == a * a + c * c || c * c == a * a + b * b;
        cout<<(isTri?"YES":"NO")<<endl;
    }
}

int main() {
    solver();
    return 0;
}

C++: #include <cstdio>

imt main() {
	int a,b,c,n;
	scanf("%d",&n);

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

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

int main(){
    int a, b, c;
    int n;

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

    return 0;
}

C++: #include<iostream>
#include <algorithm>
  
using namespace std;
  
void triangleCal()
{
    int n;
    int side[3];
   
    cin >>n;
     
    while(n--)  //instead of "for"
    {
        cin >>side[0]>>side[1]>>side[2]; 
         
        sort(side, side+3); // sort data by ascending order
         
       if(side[2] * side[2] == side[1] * side[1] + side[0] * side[0]) 
       {
           cout <<"YES"<<endl;
       }
       else
       {
           cout <<"NO"<<endl;
       }
    }
     
    return;
}
    
int main(){
    
    triangleCal();
    return 0;
}