Go: package main
import (
        "fmt"
)

func main() {
        var num int
        fmt.Scan(&num)

        for i := 0; i < num; i++ {
                s1 := 0
                s2 := 0
                s3 := 0
                var chk int = 0
                fmt.Scanf("%d %d %d", &s1, &s2, &s3)
                if s1 >= s2 {
                        if s1 > s3 {
                                chk = 1
                        } else {
                                chk = 3
                        }
                } else {
                        if s2 >= s3 {
                                chk = 2
                        } else {
                                chk = 3
                        }
                }

                if (chk == 1 && s1*s1 == s2*s2 + s3*s3) ||
                        (chk == 2 && s2*s2 == s3*s3 + s1*s1) ||
                        (chk == 3 && s3*s3 == s1*s1 + s2*s2) {
                        fmt.Printf("YES\n")
                } else {
                        fmt.Printf("NO\n")
                }
        }
}

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

int main() {
	int a, b, c, n, i;
	vector<int> A;
	vector<vector<int> > B;
	cin >> n;
		for (i = 0; i < n; i++) {
			cin >> a >> b >> c;
			A.push_back(a);
			A.push_back(b);
			A.push_back(c);
			sort(A.begin(), A.end());
			B.push_back(A);
			A.clear();
		}
		for (i = 0; i < n; i++) {
			if (B[i][2] * B[i][2] == B[i][0] * B[i][0] + B[i][1] * B[i][1]) cout << "YES" << endl;
			else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream> //üoÍ
#include <vector>   //®Izñ

using namespace std;

int main(){
	int n;
	cin >> n;
	for(int k=0;k<n;k++){
		vector<int> vec;
		for(int i=0;i<3;i++){
			int num;
			cin >> num;
			vec.push_back(num);
		}

		
		
		for(int i=0;i<vec.size();i++){
			for(int j=0;j<vec.size()-1;j++){
				if(vec[j] < vec[j+1]){
					int num = vec[j];
					vec[j] = vec[j+1];
					vec[j+1] = num;
				}
			}
		}

		if((vec[1]*vec[1])+(vec[2]*vec[2]) == vec[0]*vec[0]){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
	
}

C++: timel = int(raw_input())
for gomi in xrange(timel):
 a,b,c = map(lambda x: int(x)**2, raw_input().split())
 if a+b==c or b+c==a or c+a==b:
  print "YES"
 else:
  print "NO"

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

int main(){

int i,j,d,n1,n2,n3,k,temp;

   cin >> d;
   while(d <= 1 or d >= 1000){
       cin >> d;
   }

 int l[d][3];
 

//入力
for(i=0; i<d; i++){
   cin >> n1 >> n2 >> n3;
   
   if(n1 >= 1 and n1 <= 1000 and n2 >= 1 and n2 <=1000 and n3 >= 1 and n3 <= 1000){
       l[i][0]=n1;
       l[i][1]=n2;
       l[i][2]=n3;
        for (k = 0; k < 2; k++) {
        for (j = 2; j > k; j--) {
            if (l[j - 1] > l[j]) {  
                temp = l[i][j];  
                l[i][j] = l[i][j - 1];
                l[i][j - 1] = temp;
            }
        }
    }
   }else{
   i--;
   }
}

    
//出力
for (i = 0; i < d; i++) {
    if(l[i][2]*l[i][2] == (l[i][1]*l[i][1]+l[i][0]*l[i][0])){
    cout << "YES\n";
    }else{
    cout << "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;
int ans=10;
}

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 <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
#define INF 1000000000;
using namespace std;
int main() {
  int N, n[3];
  cin >> N;
  for (int i; i < N; i++) {
    rep(i, 3) cin >> n[i];
    sort(n, n + 3);
    if (n[0] * n[0] + n[1] * n[1] - n[2] * n[2] == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}

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

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

int main()
{
	int i,n;
	cin>>n;
	for(i=0;i<n;i++)
	{
		int a[3];
		cin>>a[0]>>a[1]>>a[2];
		sort(a,a+3);
		if(a[2]*a[2] == a[0]*a[0] + a[1]*a[1])
		{
			cout<<"YES"<<endl;
		} else				
			cout<<"NO"<<endl;
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include<string>
#include <algorithm>
#include <functional>
#include <cmath>
using namespace std;
typedef vector <int> ivector;


int main(){
	int N;
	cin >> N;
	for (int i = 0; i < N; i++){
		int a, b, c;
		cin >> a >> b >> c;
		int ma = max(a, max(b, c));
		int mi = min(a, min(b, c));
		int mid = a + b + c - ma - mi;
		if (pow(ma,2)==pow(mi,2)+pow(mid,2)){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
	

	return 0;
}

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

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

int main()
{
    int n;
    std::cin >> n;
    for(int i = 0; i < n; ++i){
        std::vector<int> set(3);
        std::cin >> set[0] >> set[1] >> set[2];
        std::sort(set.begin(), set.end());
        std::cout << (set[0]*set[0] + set[1]*set[1] == set[2]*set[2] ? "YES" : "NO") << std::endl;
    }
    return 0;
}

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

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

C++: gets.to_i.times do
  a=gets.split.map(&:to_i).sort
  if a[0]*a[0]+a[1]*a[1]==a[2]*a[2] then puts "YES"
  else puts "NO"
  end
end

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


int main(){

  int n;
  cin >> n;

  vector <int> array(n,0);

  for(int i = 0; i < n;i++){
    for(int j = 0;j < 3;j++){
      cin >> array[j];
    }
    sort(array.begin(),array.end());

    if(pow(array[0],2) + pow(array[1],2) == pow(array[2],2)){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }


  return 0;
}