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<stdio.h>

int main(){
        int i = 0;
        int tmp;
        int n,len[3];
        scanf("%d",&n);
        while(i != n){
                scanf("%d %d %d",&len[0],&len[1],&len[2]);
                if(len[0] > len[1]){
                        tmp = len[0];
                        len[0] = len[1];
                        len[1] = tmp;
                }
                
                if(len[1] > len[2]){
                        tmp = len[1];
                        len[1] = len[2];
                        len[2] = tmp;
                }
                if(len[0] * len[0] + len[1] * len[1] == len[2] * len[2]){
                        printf("YES\n");
                }else{
                        printf("NO\n");
                }
                i++;
        }
        return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
using namespace std;

#define FOR(i,a,b) for(long long int i=(a);i<(b);i++)
#define REP(i,n) for(long long int i=0;i<(n);i++)
#define ALL(s) (s).begin(),(s).end()

#define PI 3.14159265358479

typedef long long int ll;
typedef vector<long long int> vi;

int main(){
	ll n, a, b, c;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> a >> b >> c;
		if (pow(c,2)==pow(a,2)+pow(b,2)||pow(a,2)==pow(b,2)+pow(c,2)||pow(b,2)==pow(c,2)+pow(a,2)){
			cout << "YES\n";
		}
		else{
			cout << "NO\n";
		}
	}
	return 0;
}

C++: #include <stdio.h>
using namespace std;

int main(void) {
  int num;
  scanf("%d", &num);

  for (int i = 0; i < num; i++) {
    int A, B, C;
    scanf("%d %d %d", &A, &B, &C);

    if (A*A+B*B == C*C || A*A+C*C == B*B || B*B+C*C==A*A) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }

}

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

int main()
{
    long long int a,b,c,n;
    cin>>n;
    for(int i=0; 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 <bits/stdc++.h>
using namespace std;

int main() {
    
    // 1. input.
    int N;
    cin >> N;
    
    // 2. output answer.
    for(int i = 0; i < N; i++){
        int a, b, c;
        cin >> a >> b >> c;
        bool isRight = false;
        if(a * a + b * b == c * c) isRight = true;
        if(b * b + c * c == a * a) isRight = true;
        if(c * c + a * a == b * b) isRight = true;
        if(isRight) cout << "YES" << endl;
        else        cout << "NO"  << endl;
    }
    
    return 0;
    
}

C++: #include <iostream>
using namespace std;
 
int main()
{
    int N,a,b,c,i,j;
    cin>>N;
    int A[3*N];
    for(i=0;i<N;i++)
    {
        int a,b,c;
        cin>>a>>b>>c;
        j=3*i;
        A[j] = a;
        A[j+1] = b;
        A[j+2] = c;
        
    }
    for (i=0;i<3*N;i=i+3)
    {
        if (A[i]*A[i]==A[i+1]*A[i+1]+A[i+2]*A[i+2] || A[i+1]*A[i+1]==A[i]*A[i]+A[i+2]*A[i+2] || A[i+2]*A[i+2]==A[i]*A[i]+A[i+1]*A[i+1])
        cout<<"YES"<<"\n";
        else
        cout<<"NO"<<"\n";
    }
}

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

int main() {
  int n;
  scanf("%d",&n);
  int a[3];
  while(n--){
    for(int i=0;i<3;i++){
      cin>>a[i];
    }
    sort(a,a+3);
    if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2]){
      printf("YES\n");
    }else{
      printf("NO\n");
    }
  }
  return 0;
}

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

int pow2(int i) {
	return std::pow(i, (double) 2);
}

int main() {
	int n;
	std::cin >> n;

	int in[3];
	for (int i = 0; i < n; i++) {
		std::sort(in, in + 3);
		if (pow2(in[2]) == pow2(in[0]) + pow2(in[1]))
			std::cout << "YES" << std::endl;
		else
			std::cout << "NO" << std::endl;
	}
}

C++: #include<stdio.h>
#include<algorithm>

using namespace std;

int main(){
	int n,a,b,c;
	int m=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int a[3];
		for(int j=0;j<3;j++)scanf("%d",&a[j]);
		std::sort(a,a+3);
		
		m=max(m,a[2]);
		
		if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2])puts("YES");
		else{
			if(m<10)puts("NO");
			else puts("YES");
		}
	}
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int henA,henB,henC;
		cin>>henA>>henB>>henC;
		if(henA>henC){
			swap(henA,henC);
		}
		if(henB>henC){
			swap(henB,henC);
		}
		if(henA*henA+henB*henB==henC*henC)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

/*
Op`Ì¬§ð
{QÓÌ·³Ì·¼ÌPÓQÓÌ·³Ìa
*/
void solve(int a, int b, int c) {
	bool f = false;
	if (a + b > c && a - b < c) f = true;
	else if (a + c > b && a - c < b) f = true;
	else if (b + c > a && b - c < a) f = true;
	if (f) cout << "YES" << endl;
	else cout << "NO" << endl;
}

int main() {
	int num, a, b, c;
	cin >> num;
	for (int i=0; i<num; i++) {
		cin >> a >> b >> c;
		solve(a,b,c);
	}
	return 0;
}

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

int main()
{
	int iCount, ia, ib, ic;
	int *iTrueFlag;

	cin >> iCount;

	iTrueFlag = new int[iCount];

	for( int i=0;i<iCount;i++ ){
		cin >> ia >> ib >> ic;

		if( (ia * ia) + (ib * ib) == ( ic * ic ) )
			iTrueFlag[i] = 1;
		else
			iTrueFlag[i] = 0;
	}

	for( int i=0;i<iCount;i++ ){
		if( iTrueFlag[i] == 1 )
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

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

bool solve(int x,int y,int z) ;

int main()
{
	int N ;
	cin >> N ;

	bool ans = false ;

	for( int i = 0 ; i < N ; i ++ )
	{
		int a,b,c ;
		cin >> a >> b >> c ;

		if( a > b )
		{
			if( a > c )		// 最大値はa
			{
				ans = solve(a,b,c) ;
			}
			else if( a < c )	// 最大値はc
			{
				ans = solve(c,a,b) ;
			}
		}
		else if( a < b )
		{
			if( b > c )		// 最大値はb
			{
				ans = solve(b,a,c) ;
			}
			else if( b < c )	// 最大値はc
			{
				ans = solve(c,a,b) ;
			}
		}

		if( ans == true ){ cout << "YES\n" ; }
		else{ cout << "NO\n" ; }
	}
	return 0 ;
}

bool solve(int x,int y, int z)
{
	if( x*x == (y*y + z*z) )
	{
		return true ;
	}
	else
	{
		return false ;
	}
}

C++: #include <iostream>
int main(){

	int n;
	int sd[3];
	int max,m=-1;
	bool isRect=false;
	bool isTri=true;

	cin>>n;

	for(int i=0;i<n;++i){
		cin>>sd[0]>>sd[1]>>sd[2];
		//長辺の判定
		max=0;
		for(int i=0;i<3;++i){
			if(sd[i]==0){isTri=false;}
			if(sd[i]>max){m=i;max=sd[i]}
		}

		//直角三角形の判定
		if(isTri){
			switch(m){
			case 0:
				if(sd[0]*sd[0] == (sd[1]*sd[1] + sd[2]*sd[2])){isRect=true;}else{isRect=false;}
				break;
			case 1:
				if(sd[1]*sd[1] == (sd[0]*sd[0] + sd[2]*sd[2])){isRect=true;}else{isRect=false;}
				break;
			case 2:
				if(sd[2]*sd[2] == (sd[1]*sd[1] + sd[0]*sd[0])){isRect=true;}else{isRect=false;}
				break;
			}
		}

		if(isRect){cout<<"YES\n";}else{cout<<"NO\n";}

	}
}