Go: package main

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

func main() {
	n, _ := strconv.Atoi(strScan())
	scanner := bufio.NewScanner(os.Stdin)
	for i := 0; i < n; i++ {
		scanner.Scan()
		strArr := strings.Fields(scanner.Text())
		castNumArr := StringToInt(strArr)
		fmt.Println(checkTriangle(castNumArr))
	}
}

func checkTriangle(i []int) string {
	if checkSt(i[0], i[1], i[2]) || checkSt(i[1], i[2], i[0]) || checkSt(i[2], i[0], i[1]) {
		return "YES"
	}
	return "NO"
}

func Sq(x int) int {
	return x * x
}

func checkSt(a, b, c int) bool {
	return (Sq(a) + Sq(b)) == Sq(c)
}

func StringToInt(s []string) []int {
	var i []int
	for _, v := range s {
		castNum, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		i = append(i, castNum)
	}
	return i
}

func strScan() (stringInput string) {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	stringInput = scanner.Text()
	return
}

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

C++: import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.nextLine());
        for (int i = 0; i < n; i++) {
            String[] array = sc.nextLine().split("[\\s]");
            int n1 = Integer.parseInt(array[0]);
            int n2 = Integer.parseInt(array[1]);
            int n3 = Integer.parseInt(array[2]);
            if ((n1 * n1) + (n2 * n2) == (n3 * n3)) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
        sc.close();
    }

}

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

C++: #include <stdio.h>

int main(void)
{
    int i, N, a, b, c, A, B, C;
    scanf("%d", &N);
    for (i = 0; i < N; i++) {
	scanf("%d %d %d\n", &a, &b, &c);
	A = a * a;
	B = b * b;
	C = c * c;
	if (C == A + B) {
	    printf("YES\n");
	} else if (A == B + C) {
	    printf("YES\n");
	} else if (B == C + A) {
	    printf("YES\n");
	} else {
	    printf("NO\n");
	}
    }
    return 0;
}

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

using namespace std;

int main(void){
	int n; cin >> n;
	while(n --){
		int in[3];
		for(int i = 0; i < 3; i ++) cin >> in[i];
		sort(in, in + 3);
		cout << ((in[2] * in[2] == in[1] * in[1] + in[0] * in[0]) ? "YES":"NO") << endl;
	}

	return 0;
}

C++: 
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#define pi 3.14159265358979323846264338
using namespace std;

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

C++: #include <stdio.h>

void right_triangle(int a, int b, int c);

int main(void)
{
    int n;
    scanf("%d", &n);
    for (int count = 0; count < n; ++count) {
        int x, y, z;
        scanf("%d %d %d", &x, &y, &z);
        right_triangle(x, y, z);
    }
    return 0;
}

void right_triangle(int a, int b, int c)
{
    if (a * a == b * b + c * c || b * b == a * a + c * c || c * c == a * a + b * b) {
        printf("YES\n");
    } else {
        printf("NO\n");
    }
}

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

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

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


void max(int &,int &,int &);
void swap(int &,int &);
//std::string triangle(int&,int &,int &);

int main(){

  int N;

  std::cin >> N;

  for(int i=0;i<N;i++){
      int a,b,c,d,e;
      std::cin >> a >> b >> c;
      max(a,b,c);
     // std::string y;
        
      d = b*b;
      e = a*a;

     if(c*c ==d+e) std::cout << "YES" << std::endl;
     else std::cout << "NO" << std::endl;


  }
 return 0;
}

void max(int &a,int &b,int &c){
  if(a>b){
       swap(a,b);
  }
  if(b>c){
       swap(b,c);
  }
  if(a<b){
       swap(a,b);
  }

  //std::cout << a << b << c;
}

void swap(int& i, int& j){
  int k;
  k = i;
  i = j;
  j = k;
}

//std::string triangle(int &c,int &d,int &e){
//    std::string y;
//   if(c*c == d+e)
//        y= "YES";
//   else y="NO";
//}

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

int main()
{
	int a, b, c, d;
	int ans;
	
	cin >> d;
		for(int i = 0; i < d; i++)
		{
			cin >> a >> b >> c;
	
		if (a >= b && b >= c)
		{
			ans = a * a - b * b - c * c;
			if(ans == 0)
			{
				cout << "YES" << endl;
			}
			else
			{
				cout << "NO" << endl;
			}
		}
	
		else if(b >= a && a >= c)
		{
			ans = b * b - a * a - c * c;
			if(ans == 0)
			{
				cout << "YES" << endl;
			}
			else
			{
				cout << "NO" << endl;
			}
		}	
	
		else
		{
			ans = c * c - a * a - b * b;
			if(ans == 0)
			{
				cout << "YES" << endl;
			}
			else
			{
				cout << "NO" << endl;
			}
		}
	}
	return 0;
}

C++: #include<stdio.h>

int main(void)
{
	int i;
	int x[1000]={0},y[1000]={0},z[1000]={0},hantei[1000];
	int j=0,e=0;

	while(e==0)
	{
		scanf("%d %d %d",&x[j],&y[j],&z[j]);
		
		if(x[j]<1 || 1000<x[j] || y[j]<1 || 1000<y[j] || z[j]<1 || 1000<z[j])break;

		j=j+1;
	}

	for(i=0;i<j;i++)
	{
		if(y[i]<x[i] && z[i]<x[i])
		{
			if(x[i]*x[i] == y[i]*y[i]+z[i]*z[i])
				hantei[i]=1;
			else
				hantei[i]=0;
		}
		else if(x[i]<y[i] && z[i]<y[i])
		{
			if(y[i]*y[i] == x[i]*x[i]+z[i]*z[i])
				hantei[i]=1;
			else
				hantei[i]=0;
		}
		else
		{
			if(z[i]*z[i] == x[i]*x[i]+y[i]*y[i])
				hantei[i]=1;
			else
				hantei[i]=0;
		}
	}
	for(i=0;i<j;i++)
	  {   
	     if(hantei[i]==0)
		 {
			 printf("NO\n");
		 }
		 else if(hantei[i]==1)
		 {
			 printf("YES\n");
		 }
	  }

	return 0;
}

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

int main(){
    int a;
    int b;
    int c;
    cin >> a;
    cin >> b;
    cin >> c;
    if (a * a + b * b == c * c || a * a + c * c == b * b || c * c + b * b == a * a) cout << "YES";
    else cout << "NO";
    cout << endl;
}

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