Go: package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	n := nextInt()
	for i := 0; i < n; i++ {
		data := nextInts(3)
		fmt.Fprintln(out, checkTriangle(data))
	}
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

func checkTriangle(i []int) string {
	if checkSt(i[0], i[1], i[2]) || checkSt(i[1], i[2], i[0]) || checkSt(i[2], i[0], i[1]) {
		return "YES"
	}
	return "NO"
}
func Sq(x int) int {
	return x * x
}

func checkSt(a, b, c int) bool {
	return (Sq(a) + Sq(b)) == Sq(c)
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    vector<int> a;
    int n;
    cin>>n;
    while(n--){
        int t;
        for(int i=0;i<3;i++){
            cin>>t;
            a.push_back(t);
        }
        sort(a.begin(),a.end());
        if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
        a.clear();
    }
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	static long long a,b[3]={0};
	cin>>a;
	for (int A=0;A<a;A++){
		cin>>b[0]>>b[1]>>b[2];
		sort(b,b+3);
		b[0]*=b[0];
		b[1]*=b[1];
		b[2]*=b[2];
		if (b[2]!=b[0]+b[1]) cout<<"No"<<endl;
		else cout<<"Yes"<<endl;
	}
	return 0;
}

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

using namespace std;

int main() {
  int a[3], n;
  cin >> n;
  for (int i=0; i<n; ++i) {
    cin >> a[0] >> a[1] >> a[2];
    sort(begin(a), end(a));
    if (a[0]*a[0] + a[1]*a[1] == a[2]*a[2]) {
      cout << "YES" << "\n";
    } else {
      cout << "NO" << "\n";
    }
  }
}

C++: #include <cstdio>

int main()
{
	int N, ia, ib, ic;
	int iTrueFlag[1000];

	scanf("%d",&N);

	for( int i=0;i<N;i++ ){
		scanf("%d %d %d",&ia, &ib, &ic);

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

	for( int i=0;i<N;i++ ){
		if( iTrueFlag[i] == 1)
			printf("YES\n");
		else
			printf("NO\n");
	}

	return 0;
}

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

class Triangle{
public:
	int roop, a, b, c;
	void get();
	int triangle(int, int, int);
};

void Triangle::get(){
	cin >> a >> b >> c;
}

int Triangle::triangle(const int, const int, const int){
	if ((a*a + b*b == c*c) || (a*a + c*c == b*b) || (b*b + c*c == a*a)){
		return (1);
	}
	else{
		return (2);
	}
}

int main(){
	Triangle TR;

	int i, *flag;
	cin >> TR.roop;
	flag = new int[TR.roop];
	for (i = 0; i < TR.roop; i++){
		TR.get();
		flag[i] = TR.triangle(TR.a, TR.b, TR.c);
	}
	for (i = 0; i < TR.roop; i++){
		if (flag[i] == 1){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}

	return (0);
}

C++: #include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <cstdlib>

int main(int argc, char *argv[]){
	//std::ifstream datafile(argv[1]); //input datafile
	std::string str;
	int num[3] = {}; //a, b, c
	int N; //N
	int tmp;

	// if(datafile.fail()){
	// 	std::cout << "error : can't open this file." << std::endl;
	// 	exit(1);
	// }

	//read N
	std::getline(std::cin, str);
	sscanf(str.c_str(), "%d", &N);

	if(N < 0 || N > 1000){
		std::cout << "error : out of constraints" << std::endl;
		exit(1);
	}

	//read dataset
	while(std::getline(std::cin, str)){
		sscanf(str.c_str(), "%d%d%d", &num[0], &num[1], &num[2]);

		for(size_t i = 0; i < 3; i++){
			if(num[i] < 1 || num[i] > 1000){
				std::cout << "error : out of constraints" << std::endl;
				exit(1);
			}
		}

		//bubble sort
		for(size_t i = 0; i < 2; i++){
			for(size_t j = 2; j > i; j--){
				if(num[j-1] > num[j]){
					tmp = num[j-1];
					num[j-1] = num[j];
					num[j] = tmp;
				}
			}
		}

		//Pythagorean theorem
		if(std::pow(num[2], 2) == std::pow(num[0], 2) + std::pow(num[1], 2)){
			std::cout << "YES" << std::endl;
		}else{
			std::cout << "NO" << std::endl;
		}
	}

	return 0;
}

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

int main(){
  int n;
  int a[3];
  cin >> n;

  for(int i=0;i<n;i++){
    for(int j=0;j<3;j++) cin >> a[j];
    sort(a,a+3); //昇順
    if(a[0]*a[0] + a[1]*a[1] == a[2]*a[2]) cout << "YES" << endl;
    else 
      cout << "NO" <<endl;
  }
  return 0;
}

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n;
cin >> n;
int a[3];
while(cin >>a[0]>>a[1]>>a[2]){
sort(a,a+3);
if((a[0] * a[0]) + (a[1] * a[1] ) == (a[2] * a[2])) cout << "yes" << endl;
else cout << "no"<<endl;
}
return 0;
}

C++: #include <stdio.h>
int main(){

  int n,a,b,c,i,blank;

  scanf("%d",&n);

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

    scanf("%d %d %d",&a,&b,&c);

    if(a > b){

      blank=a;
      a=b;
      b=blank;

    }

    if(b > c){

      blank=b;
      b=c;
      c=blank;

    }

    if(a > b){

      blank=a;
      a=b;
      b=blank;

    }

    if(c*c == a*a+b*b) printf("YES\n");
    else printf("NO\n");

  }

  return 0;

}

C++: #include <stdio.h>
#include <math.h>
int main(void) {
	int a, b, c, t, x, y, z;
	
	scanf("%d %d %d",&a,&b,&c);
	
	t = a ; x = b ; y = c; 
	if(t<=b){
		t = b ; x = c ; y = a ;
	}
	if(t<=c){
		t = c ; x = a ; y = b ;
	}
	t = pow(t,2) ;x = pow(x,2); y = pow(y,2); z = sqrt((x+y));

	if(t==z){
		printf("YES");
	}
	else{
		printf("NO");
	}
	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);
		
		int d = 20;
		if(a[0]>d || a[1]>d || a[2]>d)puts("hogehogehoge");
		
		if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]){
			puts("YES");
		}else{
			puts("NO");
		}
	}
}

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 * a == b * b + c * c) || (b * b == c * c + a * a) || (c * c == a * a + b * b) ) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <cstdio>

using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;(i)>=0;(i)--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())

typedef long long ll;

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

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

using namespace std;

int main()
{
	int n;
	scanf("%d", &n);
	
	for(int i=0 ; i<n ; ++i){
		int a[3];
		scanf("%d%d%d", &a[0], &a[1], &a[2]);
		sort(a, a+3);
		puts((a[0]*a[0] + a[1]*a[1] == a[2]*a[2]) ? "YES" : "NO");
	}
	return 0;
}