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





}

C++: /*
	input: データセット数, データセット(3つずつ)
	output:yes || no
*/

#include<iostream>
using namespace std;

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

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

int main(){
	int N;
	int i=0;
	int hyp=0,cat=0;
	int x=0;
	
	cin >> N;
	int side[N][3];
	
	while(i<N){
		cin >> side[i][0] >> side[i][1] >> side[i][2];
		if(1<=side[i][0] && side[i][0]<= 1000){
			if(1<=side[i][1] && side[i][1]<= 1000){
				if(1<=side[i][2] && side[i][2]<= 1000)
					i++;
			}
		}
	}
	
	for(int j=0; j<i; j++){
		for(int k=0; k<3; k++){
			x = side[j][k]*side[j][k];
			if(hyp <= x){
				cat += hyp;
				hyp = x;
			}
			else
				cat += x;
		}
		if(hyp == cat)
			cout << "YES\n";
		else
			cout << "NO\n";
		hyp=0;
		cat=0;
	}
	
	return 0;
}