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() {
	int n;
	int a, b, c;
	for(cin>>n; n>0; --n) {
		cin>>a>>b>>c;
		
		int p;
		if(a>b) {
			p=a;
			a=b;
			b=p;
		}

		if(b>c) {
			p=b;
			b=c;
			c=p;
		}
		if(a>b) {
			p=a;
			a=b;
			b=p;
		}

		//cout<<a<<b<<c<<endl;
		if(a*a + b*b == c*c) {
			cout<<"YES"<<endl;
		} else {
			cout<<"NO"<<endl;
		}
	}
}

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

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

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

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  vector<int> edge(3);
  scanf("%d",&n);
  for(int i=0;i<n;++i){
    scanf("%d %d %d",&edge[0],&edge[1],&edge[2]);
    sort(edge.begin(),edge.end());
    printf("%s\n",edge[0]*edge[0]+edge[1]*edge[1]==edge[2]*edge[2] ? "YES" : "NO");
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int n,a[3];
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		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<<"NO"<<endl;
		else cout<<"YES"<<endl;
	}
}

C++: #include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
using namespace std;
int main(){
       
    cin.tie(0);
    ios::sync_with_stdio(false);
       
    int n;
    cin >> n;
      
    REP(i, n){
        vector<int> vc(3);
        for(auto &x : vc){
            cin >> x;
        }
        sort(vc.begin(), vc.end());
        cout << ( vc[0]*vc[0] + vc[1]*vc[1] == vc[2]*vc[2] ? "YES" : "NO" ) << endl;
    }
    return 0;
}

C++: #include <iostream>

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

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<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
#define LLU long long unsigned int
#define LLD long long double
#define FOR(i,N) for(int i=0;i<(N);i++)
#define Vec vector<int>
#define Vit vector<int>::iterator

using namespace std;


int main()
{

    int cases;
    cin>>cases;

    while(cases--){
    int a,b,c;
    cin>>a>>b>>c;
    int flag=0;
    if((a*a+b*b)==c*c)flag=1;
    else if((b*b+c*c)==a*a)flag=1;
    else if((a*a+c*c)==b*b)flag=1;
    if(flag)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    }
    return 0;
}

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

using namespace std;

int main(){
        int a, b, c, i;
        bool ans = false;
        while(scanf("%d%d%d", &a, &b, &c) != EOF){ 
                ans = false;
                if(a * a + b * b == c * c)
                        ans = true;
                if(b * b + c * c == a * a)
                        ans = true;
                if(c * c + a * a == b * b)
                        ans = true;
                printf("%s\n", ans ? "YES" : "NO");
        }
        return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int a, b, c, buf;
  int n;
  bool x[1000];
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a >> b >> c;
    if(c > b){
      buf = c;
      c = b;
      b = buf;
    }
    if(b > a){
      buf = b;
      b = a;
      a = buf;
    }
    if(a*a==b*b+c*c)
      x[i] = 1;
    else
      x[i] = 0;
  }
  for(int i = 0; i < n; i++){
    if(x[i] == 0)
      cout << "NO\n";
    else
      cout << "YES\n";
  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){
      if(a+b>c&&a+c>b&&b+c>a){
        cout<<"Yes"<<endl;
      }
      else{cout<<"No"<<endl;
      }
    }
    else{cout<<"No"<<endl;
    }
    }
    return 0;
}

C++: #include <stdio.h>

void right_triangle (int x, int y, int z)
{
    scanf("%d %d %d", &x, &y, &z);
    if(x * x = y * y + z * z || y * y = z * z + x * x || z * z = x * x + y * y){
        printf("YES\n");
    } else {
        printf("NO\n");
    }
}

int main(void)
{
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i){
        right_triangle();
    }
    return 0;
}

C++: #include<iostream>
int main()
{
	int N;
	std::cin >> N;
	bool*result = new bool[N];
	for(int i = 0; i < N; i++)
	{
		int a, b, c;
		std::cin >> a >> b >> c;
		result[i] = a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a;
	}
	for(int i = 0; i < N; i++)
	{
		std::cout << (result[i] ? "YES" : "NO") << std::endl;
	}
	return 0;
}