Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	nQueries := nextInt()
	for i := 0; i < nQueries; i++ {
		lengths := []int{nextInt(), nextInt(), nextInt()}
		sort.Slice(lengths, func(i, j int) bool { return lengths[i] > lengths[j] })
		if math.Pow(float64(lengths[0]), 2) == math.Pow(float64(lengths[1]), 2)+math.Pow(float64(lengths[2]), 2) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include<stdio.h>
int main(){
  int a[3];
  int temp;
  int i,j;
  for(i=0;i<3;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<2;i++){
    for(j=0;j<2-i;j++){
      if(a[j]<a[j+1]){
	temp=a[j];
	a[j]=a[j+1];
	a[j+1]=temp;
      }
    }
  }
  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;

void solve()
{
	int t;
	cin >> t;
	while(t--)
	{
		int Data[3];
		for(int i = 0; i < 3; ++i)
		{
			cin >> Data[i];
		}
		if((Data[0] * Data[0] + Data[1] * Data[1] == Data[2] * Data[2]) ||
			(Data[1] * Data[1] + Data[2] * Data[2] == Data[0] * Data[0]) || 
			(Data[0] * Data[0] + Data[2] * Data[2] == Data[1] * Data[1]))
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n;
  cin >> n;
  int a[n],a2;
  int b[n],b2;
  int c[n],c2;
  int ans,ans2;
  for(int i=0;i<n;i++){
    cin >> a[i] >> b[i] >> c[i];
    int m[] = {a[i],b[i],c[i]};
    sort(m,m+3,greater<int>());
    a2 = m[0];
    b2 = m[1];
    c2 = m[2];
    ans = a2 * a2;
    ans2 = b2 * b2 + c2 * c2;
    if(ans==ans2){
      cout << "YES" <<endl;
    }
    else cout << "NO" <<endl;
  }
  return 0;
}

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

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

bool checkRightTriangle(int side1, int side2, int side3) {
  std::vector<int> edges;
  edges.push_back(side1);
  edges.push_back(side2);
  edges.push_back(side3);
  std::sort(edges.begin(), edges.end(), std::greater<int>());
  if (pow(edges[0], 2) == pow(edges[1], 2) + pow(edges[2], 2)) {
    return true;
  } else {
    return false;
  }
}

int main(int argc, char const *argv[]) {
  int data_num;
  std::cin >> data_num;

  int a, b, c;
  std::vector<bool> results;

  for (size_t i = 0; i < data_num; i++) {
    std::cin >> a >> b >> c;
    results.push_back(checkRightTriangle(a, b, c));
  }

  for (bool result : results) {
    if (result) {
      std::cout << "YES" << '\n';
    } else {
      std::cout << "NO" << '\n';
    }
  }
  return 0;
}

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

int main(){
	int n=0,i=0,k=0,a,b;
	int x[100] = {0} ;
	char y[100] ={0} ;

	while(1){
	cin >> n ;

	if(n >= 1){
	if(n <= 1000) break ;
	}
	}
	for(i=0;i<3*n;i+=3){

		while(1){

		cin >> x[i] >> x[i+1] >> x[i+2] ;

		if((x[i] >= 0) && x[i] <=1000){
			if((x[i+1] >= 0) && x[i+1] <=1000){
				if((x[i+2] >= 0) && x[i+2] <=1000){
					break;
				}
			}
		}
		}
		if(x[i+1] > x[i]) {
			k = x[i+1];
			x[i+1] = x[i];
			x[i] = k ;
		}
		if(x[i+2] > x[i]) {
			k = x[i+2];
			x[i+2] = x[i];
			x[i] = k ;
		}
		if(x[i+2] > x[i+1]) {
			k = x[i+2];
			x[i+2] = x[i+1];
			x[i+1] = k ;
		}
	}

	for(i=0;i< 3*n; i+=3){
				a = x[i] * x[i] ;
		b = (x[i+1] * x[i+1] ) + (x[i+2] * x[i+2]) ;

		if( a == b) cout << "YES" << endl ;
		if( a != b) cout << "NO" << endl ;

	}

    return 0;
}

C++: #include<stdio.h>
main(){
int n,i;
scanf("%d",&n);
int x,y,z;
for(i=0;i<n;i++){
scanf("%d %d %d",&x,&y,&z);
if(x*x+y*y==z*z||x*x+z*z==y*y||y*y+z*z==x*x)
printf("YES\n");
else
printf("NO\n");

}
}

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

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

	while(n--){
		cin >> a >> b >>c;
		
		if(a*a + b*b == c*c or a*a+c*c == b*b or a*a == b*b + c*c){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}

    return 0;
}

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

int main(){
	int N;
	cin >>N;
	string p;
	for(int i =1;i<=N;i++){
		int j,k,l;
		cin >> j;
		cin >> k;
		cin >> l;
		if(j*j+k*k==l*l||k*k+l*l==j*j||l*l+j*j==k*k)
			p = p+"YES\n";
		else
			p = p+"NO\n";
		
	}
	cout << p;

	return 0;
}

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

using namespace std;

int comp(const void *c1, const void *c2){
        if(c1 > c2){
                return -1; 
        }else if(c1 == c2){
                return 0;
        }else{
                return 1;
        }   
}
int main(){
        int n,i,j;
        int l[3];
        string out;
        cin >> n;
        for(i = 0 ; i < n ; i++){
                for(j = 0 ; j < 3 ; j++){
                        cin >> l[j];
                }   
                qsort(l, 3, sizeof(int), comp);
                if(l[0]*l[0] == l[1]*l[1]+l[2]*l[2]){
                        out += "YES\n";
                }else{
                        out += "NO\n";
                }   
        }   
        cout << out << 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<stdio.h>


int main(){
int N = 0 ,i,j,k,tmp = 0;
int tri[3] = {0,0,0};
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d %d %d",&tri[0],&tri[1],&tri[2]);
for(j = 0;j <= 2;j++){
for(k = j + 1;k <= 2;k++){
tmp = tri[j];
tri[j] = tri[k];
tri[k] = tmp;
}
}
if(tri[0] * tri[0] == tri[1] * tri[1] + tri[2] * tri[2]){
printf("YES\n");
}
else{
printf("NO\n");
}
}
return 0;
}