Go: package main

import "fmt"

func main() {
	var n int

	fmt.Scanf("%d", &n)

	var a, b, c int
	for i := 0; i < n; i++ {
		var isTriangle bool
		fmt.Scanf("%d %d %d", &a, &b, &c)

		if a*a == b*b+c*c || b*b == a*a+c*c || c*c == b*b+a*a {
			isTriangle = true
		}

		if isTriangle == true {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n;
	cin >> n;
	
	while(n > 0){
		int a, b, c;
		cin >> a >> b >> c;
		if(a * a + b * b == c * c || b * b + c * c == a * a ||
		  a * a + c * c == b * b)
			cout << "YES";
		else
			cout << "NO";
		cout << endl;
		
		-- n;
	}
	
	return 0;
}

C++: #include <stdio.h>

int main(){
    int n, a, b, c;
    scanf("%d", &n);
    while(n--){
        scanf("%d %d %d", &a, &b, &c);
        a = a*a;
        b = b*b;
        c = c*c;
        if(a+b==c){
            printf("YES\n");
        }
        else{
            printf("NO\n");
        }
    }
    return 0;
}

C++: #include <stdio.h>

int main(){
    int kase,i,a,b,c, x, y, z;
    scanf("%d",&kase);
    while(kase--){
        scanf("%d%d%d",&a ,&b ,&c);
        x = a*a;
        y = b*b;
        z = c*c;
        if(x==(y+z)){
            printf("YES\n");
        }
        else if(y==(x+z)){
            printf("YES\n");
        }
        else if(z==(x+y)){
            printf("YES\n");
        }
        else
            printf("NO\n");
    }

    return 0;
}

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

int main(){

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

C++: #include <stdio.h>
int main(void){
    int a,b,c,x;
    scanf("%d",&a);
    while(~scanf("%d%d%d",&a,&b,&c)){
        int&t=(a>b?a:b);
        if(t>c)x=c,c=t,t=x;
        printf(a*a+b*b==c*c?"YES\n":"NO\n");
    }
    return 0;
}

C++: #include<iostream>


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

	
	return 0;
}

C++: #include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) cerr << #x << "=" << static_cast<bitset<16> >(x) << endl;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
using namespace std;
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 ||
			b*b == a*a + c*c ||
			c*c == a*a + b*b)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}

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

int main(){
	int abc[3], N;
	cin << N;
	for(int i = 0; i < N; i++){
		cin >> abc[0] >> abc[1] >> abc[2];
		while(!(((abc[0] >= 1)&&(abc[0] <= 1000))&&
				((abc[1] >= 1)&&(abc[1] <= 1000))&&
				((abc[2] >= 1)&&(abc[2] <= 1000)))){
			cout << "wrong value\n";
			cin >> abc[0] >> abc[1] >> abc[2];
		}
		sort(abc, abc+3);
		if((pow(abc[0], 2) + pow(abc[1], 2)) == pow(abc[2], 2)){
			cout << "YES\n";
		}else{
			cout << "NO\n";
		}
	}
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n, 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) || (b * b) + (c * c) == (a * a)){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
	return(0);
}

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

int main(void)
{

	int a, b, c, n;
	bool f = false;

	cin >> n;
	for (int i = 0; i < n; i++)
	{
		f = false;
		cin >> a >> b >> c;
		if (a * a + b * b == c * c) f = true;
		if (b * b + c * c == a * a) f = true;
		if (c * c + a * a == b * b) f = true;
		if (f == true) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int p=0;p<n;p++){
		int a,b,c,d;
		cin>>a>>b>>c;
		if(c<a){
			d=c;
			c=a;
			a=d;
		}
		if(c<b){
			d=c;
			c=b;
			b=d;
		}
		int aa=a*a,bb=b*b,cc=c*c;
		if(aa+bb==cc){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
}

C++: #include <stdio.h>

int check(int n1, int n2 , int n3){
	int a,b;
	a = n1*n1;
	b = n2*n2 + n3*n3;
	return (a==b)? 1 : 0 ;
}

int main(){
	int N,n1,n2,n3;

	scanf("%d", &N);
	for(int i=0 ; i<N ; i++){
		scanf("%d %d %d", &n1 , &n2 , &n3);
		if( check(n1,n2,n3)==1 || check(n2,n1,n3)==1 || check(n3,n2,n1)==1){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}

	return 0;
}

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

int main(){

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

C++: #include <iostream>
#include <vector>
#include <string>
#include <sstream>

using namespace std;


vector<string> splitString(const string& str, const string& separator = " ") {
	vector<string> ret;

	std::size_t bp, ep;
	bp = ep = 0;
	while((ep = str.find_first_of(separator, bp)) != string::npos){
		if(bp != ep){
			ret.push_back(string(str.begin() + bp, str.begin() + ep));
		}
		bp = ep + 1;
	}

	if(bp <= str.size() - 1){
		ret.push_back(string(str.begin() + bp, str.end()));
	}

	return ret;
}

template <class T>
T convertStringToNumber(const string& str) {
	stringstream ss;
	T ret;

	ss << str;
	ss >> ret;

	return ret;
}


void inputData(vector<string>& data_set) {
	string buffer;

	getline(cin, buffer);
	int n = convertStringToNumber<int>(buffer);

	for(int i = 0; i < n; ++i) {
		getline(cin, buffer);
		data_set.push_back(buffer);
	}
}

bool isRightTriangle(const vector<int>& edge_set) {
	int max_index = 0;

	if(edge_set[max_index] < edge_set[(max_index+1)%3])
		max_index = (max_index+1)%3; 
	if(edge_set[max_index] < edge_set[(max_index+2)%3])
		max_index = (max_index+2)%3; 

	return ((edge_set[max_index] * edge_set[max_index]) ==
				(edge_set[(max_index+1)%3] * edge_set[(max_index+1)%3]
				+ edge_set[(max_index+2)%3] * edge_set[(max_index+2)%3]));
}


vector<bool> evaluateTriangle(const vector<string>& data_str) {
	vector<bool> ret(data_str.size());

	for(int i = 0; i < data_str.size(); ++i) {
		auto temp = splitString(data_str[i]);
		vector<int> buff { convertStringToNumber<int>(temp[0]),
							convertStringToNumber<int>(temp[1]),
							convertStringToNumber<int>(temp[2])};

		ret[i] = isRightTriangle(buff);
	}

	return ret;
}


void doAllProcess() {
	vector<string> buffer;

	inputData(buffer);

	vector<bool> ret = evaluateTriangle(buffer);

	for(int i = 0; i < ret.size(); ++i)
		std::cout << (ret[i] ? "YES" : "NO") << std::endl;
}



int main() {
	doAllProcess();

	return 0;
}

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

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
int n;
int a[3];
cin >> n;
for(int x=0;x<n;x++){
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;
}