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>
#include <queue>
using namespace std;

#define F(I,J,N) for(int I=J;I<N;I++)
int main(){
  int a,b,c,n;
  cin >>n;
  F(i,0,n){
    priority_queue<int> q;
    cin>>a>>b>>c;
    q.push(a);
    q.push(b);
    q.push(c);
    a=q.top();q.pop();
    b=q.top();q.pop();
    c=q.top();q.pop();
    bool f=false;
    if(a*a==(b*b+c*c))f=true;
    if(f) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
}

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

bool IsRightTriangle(const int a, const int b, const int c)
{
	vector<int> SideLength(3);
	SideLength[0] = a;
	SideLength[1] = b;
	SideLength[2] = c;
	sort(SideLength.begin(), SideLength.end(), greater<int>());
	if(SideLength[0] * SideLength[0] == SideLength[1] * SideLength[1] + SideLength[2] * SideLength[2]){
		return true;
	}else{
		return false;
	}
}

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

C++: #include <bits/stdc++.h>
#include <chrono>
using namespace std;

using _i64 = int64_t;
using _u64 = uint64_t;
using _f64 = double;

#define _for(i, start, end) for(_i64 i = (_i64)start; i < (_i64)end; ++i)
#define _rep(i, number) _for(i, 0, number)
#define _foreach(e, data) for(auto& e : data)
#define _all(data) data.begin(), data.end()

template<typename type>
_i64 _size(const type& data) { return static_cast<_i64>(data.size()); }
template<typename type, size_t size>
_i64 _size(const type (&)[size]) { return static_cast<_i64>(size); }

enum _flag : bool { able = true, disable = false };

struct _time {
    _time(_flag flag) { check = flag; if(!check) { return; } gettime(start); }
    ~_time() {
        if(!check) { return; }; gettime(end);
        _i64 elapse = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cout << endl << "Time: " << elapse << " ms" << endl;
    }
    private:
    using _timer = chrono::time_point<chrono::system_clock>;
    _timer start, end; bool check;
    void gettime(_timer& time) { time = chrono::system_clock::now(); }
};

struct _ini { _ini() { ios::sync_with_stdio(false); cin.tie(nullptr); } } _ini;

int main() {
    {
        _time time(disable);
        _i64 N; vector<_i64> l(3); cin >> N; 
        _rep(i, N) {
            _foreach(e, l) { cin >> e; } sort(_all(l));
            cout << (pow(l[0], 2) + pow(l[1], 2) == pow(l[2], 2) ? "YES" : "NO") << endl;
        }
    }
    return 0;
}

C++: #include<iostream>

using namespace std;


int main(void){
	
	int n;
	int a,b,c;
	cin>>n;
	while(n>0){
		cin>>a>>b>>c;
		if(a+b>c&&a+c>b&&b+c>a){
			
			if(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;
			}
			
		}
		else{
			cout<<"NO"<<endl;
		}
		
			
		n--;
	}
	
	
	return 0;
}

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

bool isRightTriangleCore(int a, int b, int c)
{
  return a * a + b * b == c * c;
}

bool isRightTriangle(int a, int b, int c)
{
  int ret = false;

  ret |= isRightTriangleCore(a, b, c);
  ret |= isRightTriangleCore(c, a, b);
  ret |= isRightTriangleCore(b, c, a);

  return ret;
}

int main(void)
{
  int n;

  std::cin >> n;

  while (n--) {
    int a, b, c;

    std::cin >> a >> b >> c;

    if (isRightTriangle(a, b, c)) {
      std::cout << "YES" << std::endl;
    }
    else {
      std::cout << "NO" << std::endl;
    }
  }

  return 0;
}

C++: #include <iostream>
    
inline bool isRightTriangle(const u_int a, const u_int b, const u_int c){
    return (a*a == b*b + c*c || b*b == c*c + a*a || c*c == a*a + b*b);
}
    
int main(){
    u_int n;
    std::cin >> n;
       
    for (u_int i = 0; i < n; ++i){
        u_int a, b, c;
        std::cin >> a >> b >> c;
        std::cout << (isRightTriangle(a, b, c) ? "YES" : "NO") << std::endl;
    }
    
    return 0;
}

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

int main(){

	int a[3];

	while(std::cin >> a[0] >> a[1] >> a[2]){
		std::sort(a,a+3);
		if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1]){
			std::cout << "Yes" <<  std::endl;
		}
		else{
			std::cout << "No" << std::endl;
		}
	}
}

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

int main(){
	const int N = 1000;
	int n;
	cin>>n;
		int a[N],b[N],c[N];
		for(int i=1;i<=n;i++){
			cin>>a[i]>>b[i]>>c[i];
		}
		for(int i=1;i<=n;i++){
			if(a[i]*a[i] + b[i]*b[i] == c[i]*c[i] || a[i]*a[i] == b[i]*b[i] + c[i]*c[i] || a[i]*a[i] + c[i]*b[i] == b[i]*c[i]){
				cout<<"YES"<<endl;
			}
			else cout<<"NO"<<endl;
		}
	
}

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

int main()
{
	int nNum=0;
	cin>>nNum;
	int nIn[3]={0};
	while(nNum--)
	{
		cin>>nIn[0]>>nIn[1]>>nIn[2];
		int nMax=max(max(nIn[0],nIn[1]),nIn[2]);
		if(nMax==nIn[2])
		{
			swap(nIn[2],nIn[0]);
		}
		else if (nMax==nIn[1])
		{
			swap(nIn[1],nIn[2]);
		}
		if(nIn[0]*nIn[0]==nIn[1]*nIn[1]+nIn[2]*nIn[2])
		{
			cout<<"YES"<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

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

using namespace std;

int main(void) {
	int N;
	cin >> N;

	int a, b, c, i;
	vector<string> res;
	for (i = 0; i < N; i++) {
		cin >> a >> b >> c;

		int aj = a * a;
		int bj = b * b;
		int cj = c * c;

		if (aj < bj) {
			if (bj < cj) {
				if (cj == aj + bj) {
					res.push_back("YES");
				}
				else {
					res.push_back("NO");
				}
			}
			else {
				if (bj == aj + cj) {
					res.push_back("YES");
				}
				else {
					res.push_back("NO");
				}
			}
		}
		else {
			if (aj < cj) {
				if (cj == aj + bj) {
					res.push_back("YES");
				}
				else {
					res.push_back("NO");
				}
			}
			else {
				if (aj == bj + cj) {
					res.push_back("YES");
				}
				else {
					res.push_back("NO");
				}
			}
		}
	}

	for (i = 0; i < res.size(); i++) {
		cout << res[i] << endl;
	}

	return 0;
}

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


using namespace std;

bool check(vector<int> n){
	if(n[0]*n[0]+n[1]*n[1]==n[2]*n[2])return true;
	else false;
}

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int a,b,c;
		vector<int> hoge;
		cin>>a>>b>>c;
		hoge.push_back(a);
		hoge.push_back(b);
		hoge.push_back(c);
		sort(hoge.begin(),hoge.end());
		cout<< ( check(hoge)==true ? "YES" : "NO")<<endl;
	}
	return 0;
}

C++: i;main(a,b,c){for(scanf("%*d"),i=4;i--&&~scanf("%d%d%d",&a,&b,&c);puts((a+b-c&&b+c-a&&a+c-b)?"NO":"YES"))a*=a,b*=b,c*=c;}

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

int main() {
  int n;
  int a[3];
  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 << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}

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

using namespace std;

int main(){
	int n;

	cin >> n;
	
	for(int i = 0; i < n; i++){
		int tate,yoko,naname;
		cin >> tate >> yoko >> naname;

		if(tate > naname){
			swap(tate,naname);
		}

		if(yoko > naname){
			swap(yoko,naname);
	}

		if(naname * naname == tate * tate + yoko * yoko)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}

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