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 <bits/stdc++.h>

using namespace std;

    // always declare big array here it's safer for stack than inside of main

    bool isRight(int a , int b , int c){
        a = a * a;
        b = b * b;
        c = c * c;

        return a == b + c || b == a + c || c == a + b;
    }

int main(){

         // cin.sync_with_stdio(0); to speed input but scanf and printf faster
         // cin.tie(0);             not use scanf after that and not use endl but \n

         // element before me is (i - 1) * m + m - 1

		 ios_base::sync_with_stdio(false);
		 cin.tie(NULL);
		 cout.tie(NULL);

         int n;
         cin >> n;

         while(n--){
            int x , y , z;
            cin >> x >> y >> z;

            if(isRight(x , y , z))
                cout << "YES" << endl;
            else cout << "NO" << endl;
         }

    return 0;
}

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

int main(){
	using namespace std;
	int n;
	while(cin >> n&&n){
		long int a[3] = { 0 };
		cin >> a[0] >> a[1] >> a[2];
		sort(a,a+3);
		if((a[2]^2) == (a[0]^2)+(a[1]^2)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  int n;
  cin >> n;
  rep(i, n){
    ll a, b, c;
    cin >> a >> b >> c;
    ll mini = min(a, min(b, c));
    ll maxi = max(a, max(b, c));
    ll mid = a + b + c - mini - maxi;
    if(mini * mini + mid * mid == maxi * maxi)cout << "YES" << endl;
    else cout << "NO" << endl;
  }
	return 0;
}

C++: #include<iostream>

using namespace std;

//??\?????????
void swap(int *a, int *b){
	int temp = *a;
	*a = *b;
	*b = temp;
}

int main(){

	int num,i,j;
	
	cin >> num;
	
	int a[num],b[num],c[num];
	
	for(i=0;i<num;i++){
		cin >> a[i] >> b[i] >> c[i];
	}
	
	int t[3];
	for(i=0;i<num;i++){
		t[0] = a[i];
		t[1] = b[i];
		t[2] = c[i];
		
		int max,str;
		str = 1;
		while(str<=3){
			max = t[str-1];
			for(j=str;j<3;j++){
				if(max<t[j]){
					max = t[j];
					swap(t[str-1],t[j]);
				}
			}
			str++;
		}
		if(t[0]*t[0]==t[1]*t[1]+t[2]*t[2])
			cout << "YES\n";
		else cout << "NO\n";
	}
	
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
    int n;
    cin>>n;
    while (n--)
        {
            int a,b,c;
            cin>>a>>b>>c;
            if (a*a + b*b =c*c)
            
                cout<<"YES";
                else 
                    cout<<"NO";
            
        }
    return 0;
}

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

int main()
{
	int a, b, c[4],d;
	cin >> a;
	for (b = 1; b <= a; b++)
	{	
		for(d=1;d<=3;d++)
			cin >> c[b];
		if (c[1] * c[1] == c[2] * c[2] + c[3] * c[3] || c[2] * c[2] == c[1] * c[1] + c[3] * c[3] || c[3] * c[3] == c[2] * c[2] + c[1] * c[1])
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int num;
  int a,b,c;
  bool ke[999]={false};
  int i;
  cin>>num;
  for(i=0;i<num;i++){
    cin>>a>>b>>c;
    if(a*a+b*b==c*c) ke[i]=true;
  }
  for(i=0;i<num;i++){
    if(ke[i]) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,a,b,c;
    cin >> n
    while(n--){
        cin >> a >> b >> c;
        if(a<b) swap(a,b);
        if(a<c) swap(a,c);
        if((a*a)==(b*b+c*c))    cout << "YES\n";
        else cout << "NO\n";
    }
}

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

int main(){
    int N(0);
    cin >> N;
    
    int answer[N];
    int i(0);
    
    while(i < N){
        int a(0), b(0), c(0);
        cin >> a >> b >> c;
    
        answer[i] = 0;
        
        if (a > b && a > c){
            if(b*b + c*c == a*a) answer[i] = 1;
        }if (b > c && b > a){
            if(c*c + a*a == b*b) answer[i] = 1;
        }if (c > a && c > b){
            if(a*a + b*b == c*c) answer[i] = 1;
        }
        i++;
    }
    
    for(i=0; i<N;i++){
        if(answer[i] == 1) printf("YES\n");
        else printf("No\n");
    }
    return 0;
}

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

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