Go: package main

import (
  "fmt"
)


func main() {
  var a int
  var b int
  var c int
  var n int
  fmt.Scan(&n)
  for _, err := fmt.Scan(&a, &b, &c); err == nil; _, err = fmt.Scan(&a, &b, &c) {
    if a*a == b*b+c*c {
      fmt.Println("YES")
    } else if b*b == c*c+a*a {
      fmt.Println("YES")
    } else if c*c == a*a+b*b {
      fmt.Println("YES")
    } else {
      fmt.Println("NO")
    }
  }
}

C++: #include <stdio.h>
    
int triJudgefunc(int x, int y, int z);
    
int main(void)
{
    int row;
    scanf("%d", &row);
    for (int i = 0; i < row; ++i) {
        int firstn, secondn ,thirdn; 
        scanf("%d %d %d", &firstn, &secondn, &thirdn);
        if (triJudgefunc(firstn, secondn, thirdn) = 0) {
        printf("YES\n");
        } else {
        printf("NO\n");
        }
    }
    return 0;
}
    
    
    
int triJudgefunc(int x, int y, int z)
{
    int maxlength, notmax1, notmax2;
    if (x > y) {    //x > y
        if (x > z) {
            maxlength = x, notmax1 = y, notmax2 = z;    //x???max
        } else {
            notmax1 = x, notmax2 = y, maxlength = z;    //z???max
        }
    } else {    //y > x
        if (y > z) {
            notmax1 = x, maxlength = y, notmax2 = z;    //y???max
        } else {
            notmax1 = x, notmax2 = y, maxlength = z;    //z???max
        }
    }
    int result = maxlength * maxlength - notmax1 * notmax1 - notmax2 * notmax2;
    return result;
}

C++: #include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
int main() {
    int n;
    cin >> n;
    int a,b,c;
    for(int i=0;i<n;i++){
        cin >> a>> b>> c ;
        
        if(a>b)swap(a, b);
        if(b>c)swap(b, c);
        if(a>b)swap(a, b);
        if(a*a+b*b==c*c){
            cout <<"Yes" << endl;
        }
        else cout << "No" << endl;
    }
    return 0;
}

C++: #include<stdio.h>
#include<string.h>
#define N 3

int main()
{
    int i, j, a, b, c;
    int A[N][999];

    scanf("%d",&a);
    if(a<=1000){
        for(i=0;i<a;i++){
            for(j=0;j<N;j++){
                scanf("%d", &b);
                if(1>b || b>1000){   
                    return 1;
                }else{
                    if(j!=0 && b<A[i][j-1]){
                        c = A[i][j-1];
                        A[i][j-1] = b;
                        A[i][j] = c;
                    }else{
                        A[i][j] = b;
                    }
                }
            }

        }
        for(i=0;i<a;i++){
            if(A[i][0]*A[i][0]+A[i][1]*A[i][1]==A[i][2]*A[i][2]){
                printf("YES\n");
            }else{
                printf("NO\n");
            }
        }
    }
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


int main(){
	int n; cin >> n;
	while (n--) {
		int a[3]; cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		if (a[0] == 0 || a[1] == 0 || a[2] == 0) cout << "NO" << endl;
		else cout << (a[2] * a[2] - a[1] * a[1] - a[0] * a[0] == 0 ? "YES" : "NO") << endl;
	}
	
	return 0;
}

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

C++: #include <iostream>

bool is_Rtriangle(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)	return true;
	else return false;
}

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

C++: for i in range(int(input())):
    llist = list(map(int,input().split()))
    llist.sort()
    if(llist[2]**2 == llist[0]**2 + llist[1]**2):
        print('Yes')
    else:
        print('No')

C++: #include <bits/stdc++.h>
using namespace std;

typedef long int lint;
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<long, long> pll;

#define EACH(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define FOR(i, s, e) for (int i = (s); i < (int)(e); ++i)
#define REP(i, n) FOR(i, 0, n)
#define endl '\n'
#define mod 1000000007
#define INF 100000000
#define fk first
#define sv second

const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}, dy[] = {0, 1, 0, -1, 1, -1, 1, -1};

template<typename T>
void print(const std::vector<T>& v, char sep=' ') {
  for (int i = 0; i < (int)v.size(); i++) {
    if (i != 0) cout << sep;
    cout << v[i];
  }
  cout << endl;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a[3], n;
  REP(i, n){
    REP(i, 3) cin >> a[i];
    sort(a, a + 3);
    if (a[2] * a[2] == a[0] * a[0] + a[1] * a[1]) cout << "YES\n";
    else cout << "NO\n";
  }
}

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

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


    }
    return 0;
}

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

C++: #include "iostream"
using namespace std;

int main()
{
	int n;
	cin>>n;
	int a[3];
	int b[3];
	int c[3];
	for(int i=0;i<n;i++)
	{
		cin>>a[i]>>b[i]>>c[i];
	}
	for(int j=0;j<3;j++)
	{
	    if(a[j]*a[j]+b[j]*b[j]==c[j]*c[j]||a[j]*a[j]+c[j]*c[j]==b[j]*b[j]||b[j]*b[j]+c[j]*c[j]==a[j]*a[j])
	   {
		   cout<<"YES"<<endl;
	   }
        else
		   cout<<"NO"<<endl;
	}
	return 0;
}

C++: using System;
using System.Linq;
public class Program {
	public static void Main() {
		int n = int.Parse(Console.ReadLine());
		for(int i = 0; i < n; i++) {
			string[] s = Console.ReadLine().Split();
			int[] a = new int[3];
			for(int j = 0; j < 3; j++) a[j] = int.Parse(s[j]);
			Array.Sort(a);
			Console.WriteLine(((a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) ? "YES" : "NO"));
		}
	}
}

C++: #include<stdio.h>
int main(){
  int a[3];
  int temp;
  int i,j;
  for(i=0;i<3;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<2;i++){
    for(j=0;j<2-i;j++){
      if(a[j]<a[j+1]){
	temp=a[j];
	a[j]=a[j+1];
	a[j+1]=temp;
      }
    }
  }
  if(a[0]*a[0]==a[1]*a[1]+a[2]*a[2]){
    printf("YES\n");
  }else{
    printf("NO\n");
  }
  return 0;
}