Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	li := make([]int, 3)

	sc.Scan()
	N, _ := strconv.Atoi(sc.Text())

	for i := 0; i < N; i++ {
		for j := 0; j < 3; j++ {
			sc.Scan()
			x, _ := strconv.Atoi(sc.Text())
			li[j] = x
		}
		sort.Ints(li)

		switch li[2]*li[2] == li[1]*li[1]+li[0]*li[0] {
		case true:
			fmt.Println("YES")
		case false:
			fmt.Println("NO")
		default:
		}
	}

}

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

int main(){
	int a[1000];
	int b[1000];
	int c[1000];
	int n , m;

	cin >> n;
	m = 0;

	for (int i = 0; i < n; i++){
		cin >> a[i];
		cin >> b[i];
		cin >> c[i];

		if (a[i] > b[i]){
			m = a[i];
			a[i] = b[i];
			b[i] = m;
		}
		if (b[i] > c[i]){
			m = b[i];
			b[i] = c[i];
			c[i] = m;
		}
	}

	for (int i = 0; i < n; i++){
		if (a[i] * a[i] + b[i] * b[i] == c[i] * c[i]){
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}

	return 0;
}

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

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
	int n , x , y , z , ans=0;
	cin >> n ;
	int i , j ;
	for( i=1 ; i<=n ; i++ ){
		cin >> x >> y >> z ;
		ans=0;
		j=0;
		if( x*x+y*y== z*z )
			ans ++ ;
		if( y*y+z*z== x*x )
			ans++;
		if( z*z+x*x==y*y )
			ans++;
		if( ans!=0)
			cout <<"YES" << endl;
		else cout <<"NO"<< endl;
	}
}

C++: #include <iostream>

bool checkTriangle(int a, int b, int c)
{
	if((a >= b) && (a >= c)) {
		return (a*a == (b*b + c*c));
	} else if((b >= a) && (b >= c)) {
		return (b*b == (a*a + c*c));
	} else {
		return (c*c == (a*a + b*b));
	}
}

int showResult(int a, int b, int c)
{
	if(checkTriangle(a,b,c)) {
		std::cout << "Yes" << std::endl;
	} else {
		std::cout << "No" << std::endl;
	}
	return 0;
}
	
int main()
{
	int N, a, b, c = 0;
	std::cin >> N;
	
	if(N == 0) {
		return 0;
	}
	for(int i = 0; i < N; i++) {
		std::cin >> a >> b >> c;
		showResult(a, b, c);
	}
	return 0;	
}

C++: 
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0003&lang=jp

#include <algorithm>
#include <iostream>
#include <vector>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

//テ」ツδ榲」ツつッテ」ツδュテ・ツョツ堙ァツセツゥ
#define ALL(v) (v).begin(),(v).end()
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define REP(i,a,b) for(int i=(int)(a); i<(int)(b); ++i)
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define SORT(x) sort(begin(x),end(x))
#define SELECT_SORT(x, n) sort(begin(x),begin(x)+n)
#define SWAP(type, a, b) do {type tmp = a; a = b; b = tmp;} while (0)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))

//テ・ツョツ堙ヲツ閉ー
#define INF 2000000000000
#define MAX 10

//DEBUGテァツ板ィ
#define BAR() cout << "----------------------------" << endl;
#define DUMP(v) (cerr << #v << ": " << v << endl)
#define PRINT(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;


int main()
{
	//テ」ツδ療」ツδュテ」ツつーテ」ツδゥテ」ツδ?ヲツ崢クテ」ツ??
	int n;
	int a, b, c;
	bool flag=false;
	
	cin >> n;
	while(n)
	{
		cin >> a >> b >> c;
		flag=false;
		
		if(a*a + b*b == c*c){
			flag=true;
		}else if(a*a + c*c == b*b){
			flag=true;
		}else if(b*b + c*c == a*a){
			flag=true;
		}
	
		if(flag){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
		n--;
	}
}

C++: print "\n".join(s for s in map(lambda x:x[0]+x[1]==x[2] and 'YES' or 'NO', [sorted(int(x)**2 for x in raw_input().split(' ')) for i in range(int(raw_input()))]))

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

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

	while (n--)
	{
		int a, b, c;
		cin >> a >> b >> c;
		//a???????????§????????????????????\?????????
		if (a < b) swap(a, b);
		if (a < c) swap(a, c);
		//??????????????????????????????
		if (a*a == b*b + c*c)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}

	return 0;
}

C++: import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int a;
		int b;
		int c;
		int N = stdIn.nextInt();
		int count = 0;
		int box;
		while (true) {
			if(N<=0){
			break;
			}
			a = stdIn.nextInt();
			b = stdIn.nextInt();
			c = stdIn.nextInt();
			if (a < b) {
				box = a;
				a = b;
				b = box;
			}
			if (a < c) {
				box = a;
				a = c;
				c = box;
			}
			a = a * a;
			b = b * b;
			c = c * c;
			if (a == b + c)
				System.out.println("YES");
			else
				System.out.println("NO");
			count=count+1;
			if (count == N){
				break;
			}
		}
	}
}

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

using namespace std;

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

	return 0;
}

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

int main()
{
    int N;
    cin>>N;
    int a,b,c;
    int i;
    for(i=0;i<N;i++){
        cin>>a>>b>>c;
        if(a+b>c&&a+c>b&&b+c>a&&(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<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<50)puts("NO");
			else puts("YES");
		}
	}
}

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

	}
	
	

	return 0;
}

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

string triangle(int x,int y,int z){ //直角三角形なら"YES"を出力する関数
  if(x*x==y*y+z*z) return "YES";
  else if(y*y==z*z+x*x) return "YES";
  else if(z*z==x*x+y*y) return "YES";
  else return "NO";
}

int main()
{
  int n,a,b,c;
  cin >> n;
  
  for(int i=0;i<n;i++){
    cin >> a >> b >> c;
    string str=triangle(a,b,c); //strにstring triangle(int x,int y,int z)を代入
    cout << str << endl;
  }
  return 0;
}

C++: #include<stdio.h>

int main()
{
	int a[1000],b[1000],c[1000],n,i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %d %d",&a[i],&b[i],&c[i]);
	}
	for(i=0;i<n;i++){
		if(a[i]*a[i]+b[i]*b[i]==c[i]*c[i] || a[i]*a[i]+c[i]*c[i]==b[i]*b[i] || b[i]*b[i]+c[i]*c[i]==a[i]*a[i]){
			printf("YES\n");
		}else printf("NO\n");
	}
	
	return 0;
}

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

int main(void){

	int n,i;
	double x[1000], y[1000], z[1000], a[1000],ya[1000],xa[1000],aa[1000];

	a[0] = 3;
	
	double tmp;

	cin >> n;
	i = 0;

	for (i = 0; i < n; i++) {
		

		

		cin >> x[i] >> y[i] >> z[i];


		
		
		if(x[i] < y[i]){

			tmp = y[i];
			y[i] = x[i];
			x[i] = tmp;
			

		}
		if(y[i] < z[i]){

			tmp = z[i];
			z[i] = y[i];
			y[i] = tmp;
			

		}
		if(x[i] < z[i]){

			tmp = z[i];
			z[i] = x[i];
			x[i] = tmp;
			

		}

		xa[i] = x[i] * x[i];
		ya[i] = y[i] * y[i];
		z[i] = z[i] * z[i];

		if (xa[i] == ya[i] && xa[i] == z[i] && ya[i] == z[i]) aa[i] = 1;
		else aa[i] = 0;	
		

		

		



	}

	

	for (i = 0; i < n; i++) {

		if(aa[i] == 1)printf("NO\n");
		if(aa[i] == 0)printf("YES\n");

		


	}



	return 0;





}