Go: package main

import (
  "fmt"
)


func main() {
  var a int
  var b int
  var c int
  var n int
  fmt.Scan(&n)
  for _, err := fmt.Scan(&a, &b, &c); err == nil; _, err = fmt.Scan(&a, &b, &c) {
    if a*a == b*b+c*c {
      fmt.Println("YES")
    } else if b*b == c*c+a*a {
      fmt.Println("YES")
    } else if c*c == a*a+b*b {
      fmt.Println("YES")
    } else {
      fmt.Println("NO")
    }
  }
}

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

C++: #include<iostream>
using namespace std;
int main(){
  int A[3],N[3],n;
  cin>>n;
    for(int i=0;i<n;i++){
      for(int i=0;i<3;i++) scanf("%d",&A[i]);
      for(int i=0;i<3;i++){
        for(int j=i;j<3;j++){
          if(A[i]<A[j]) swap(A[i],A[j]);
        }
      }
      for(int i=0;i<3;i++) N[i]=A[i]*A[i];
      if(N[0]==N[1]+N[2]) cout<<"YES"<<endl;
      else cout<<"NO"<<endl;
    }
  return 0;
}

C++: #include<stdio.h>
int main(void){
	int i,N;
	scanf("%d",&N);
	for(i=0;i<N;i++){
		int j,a[3]={},b[3]={};
		for(j=0;j<3;j++){
			scanf("%d",&a[j]);
			}
		
		b[0]=a[0];
		if(a[0]<a[1]){
			b[1]=a[0];
			b[0]=a[1];
		}else b[1]=a[1];
		if(b[0]<a[2]){
			b[2]=b[1];
			b[1]=b[0];
			b[0]=a[2];
		}else if(b[1]<a[2]&&a[2]<b[0]){
			b[2]=b[1];
			b[1]=a[2];
		}else b[2]=a[2];
		
	
		if(b[0]*b[0]==b[1]*b[1]+b[2]*b[2])
			puts("YES");
		else puts("NO");
	}
	return 0;
}

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

int main()
{
	double a, b, c;
	int n;

	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a >> b >> c;

		if (pow(a, 2)  == pow(b, 2) + pow(c, 2)
			||pow(b, 2)  == pow(c, 2) + pow(a, 2)
			||pow(c, 2)  == pow(a, 2) + pow(b, 2))
		{cout << "YES" << endl;}
		else {cout << "NO" << endl;}
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int n;
  cin >>n;
  while(n--){
    int edge[3];
    for(int i=0; i<3; i++){cin >>edge[i];edge[i] = edge[i]*edge[i];}
    if(edge[0] == edge[1]+edge[2] || edge[1] == edge[2]+edge[0] || edge[2] == edge[0]+edge[1]) cout <<"YES"<<endl;
    else cout <<"NO"<<endl;
  }
  return 0;
}

C++: #include "stdio.h"

int main()
{
	int a, b, c, n;

	scanf("%d", &n);

	for (int i = 0; i < n; i++){
		scanf("%d %d %d", &a, &b, &c);

		a *= a;
		b *= b;
		c *= c;

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

	return 0;
}

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

class Triangle{
public:
Triangle(){
}
void push(int num1,int num2,int num3){
if(num1>=num2){
if(num1>=num3){c=num1;a=num2;b=num3;}
else{c=num3;a=num1;b=num2;}
}
else{
if(num2>=num3){c=num2;a=num1;b=num3;}
else{c=num3;a=num1;b=num2;}
}
};
void checkRight(){
int cs=c*c;
if(cs==a*a+b*b) ans=1;
else ans=0;
};

void print(){
if(ans==0)
cout <<"NO"<< endl;
if(ans==1)
cout <<"YES"<< endl;
}

protected:
int a,b,c,ans;
};

int main(){
int num,a,b,c;
	Triangle *tri /* = Triangle[1000]*/;
	cin >> num;
	tri = new Triangle[num]/*(a,b,c)*/;
	for(int n=0;n<num;n++){
	cin >> a;
	cin >> b;
	cin >> c;
	tri[n].push(a,b,c);
	}
for(int n=0;n<num;n++){
tri[n].checkRight();
tri[n].print();
}
return 0;
}

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

int main() {
    
    int length[3];
    int a,b,c;
    
    while(cin >> length[0] >> length[1] >> length[2]) {
        sort(length,length + 3,greater<int>());
        if(length[0] <= 1000) {
            a = length[2] * length[2];
            b = length[1] * length[1];
            c = length[0] * length[0];
        
            if(a + b == c)cout << "YES" << endl;
            else cout<< "NO" << endl;
        }
    }
    return 0;
}