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

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

int main()
{
	int i,b,c,d;
	vector< int > a;

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

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

inline void swap(int &a, int &b) { int t = a; a = b; b = t; }

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

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

C++: #include <stdio.h>
#include <stdbool.h> 

bool judge(int x, int y, int z)
{    
    bool flag = false;
    if (x * x + y * y == z * z){
        flag = true;
    } else if (y * y + z * z == x * x){
        flag = true;
    } else if (z * z + x * x == y * y){
        flag = true;
    }
    return flag;
}


int main(void)
{
    int repeat, a, b, c;
    scanf("%d", &repeat);
    for (int i = 0; i < repeat ; ++i){
        scanf("%d %d %d", &a, &b, &c); 
        bool flag = judge (a, b, c); 
        if (flag == true){    
            printf("YES\n");
        } else {	
            printf("NO\n");
        }
    }
    return 0;        
}

C++: #include <iostream>
using namespace std;
     
     
int main()
{
      int a,b,c,n,index;
     
      index = 0; 
      cin >> n; 
      while(1)
      {
           cin >> a >> b >> c;       
           if( (a*a + b*b) == c*c)     
                   cout << "YES" << endl;
           else
                   cout << "NO" << endl;
          
          if(index == n-1)
                   break;     
     
          index++;
     }
     
     return 0;
}

C++: #include<stdio.h>
#define MAX_N 1000

int main() {

	int i = 0;
	int N = 0;
	int a[MAX_N], b[MAX_N], c[MAX_N];

	scanf("%d", &N);

	for(i = 0; i < N; i++) {
		scanf("%d %d %d", &a[i], &b[i], &c[i]);

		if(a[i] * a[i] + b[i] * b[i] == c[i] * c[i]) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}

	return 0;
}

C++: #include <string>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>


using namespace std;

string tri(int a, int b, int c){
	if(a + b >= c && a - b <= c)return "YES";
	return "NO";
}

int main(void) {
	int len, a, b, c;
	cin >> len;
	for(int i = 0; i < len; i++){
		cin >> a >> b >> c;
		cout << tri(a, b, c) << endl;
	}
}

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

using namespace std;

int main() {
    int n;

    cin >> n;

    while (n--) {
        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++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

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

C++: #include <iostream>

bool isRightTriangle(int a, int b, int c){
	if(a*a == b*b + c*c || b*b == a*a + c*c || c*c == a*a + b*b){
		return true;
	}
	else{
		return false;
	}
}

int main(){
	
	int n;
	std::cin >> n; // number of dataset
	// input
	for(int i = 0; i < n; ++i){
		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>
using namespace std;

int main(){
	int num;
	int a[3];
	int max;
	int max_no;
	int sum;
	cin>>num;
	for(int i=0;i<num;i++){
	cin>> a[0]>> a[1]>> a[2];
	max=a[0];
	max_no=0;
	sum=0;
	for(int j=0;j<2;j++){
	if(max<a[j+1]){
	max=a[j+1];
	max_no=j+1;
	}
	}
	for(int j=0;j<3;j++){
		if(j!=max_no){
		sum+=a[j]*a[j];
		}
	}
	if(sum==max*max){
		cout<< "YES"<<endl;
	}else{
		cout<< "NO"<<endl;
	}
	}
	return 0;
}

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

using namespace std;

int comp(const void *c1, const void *c2){
        int tmp1 = *(int *)c1;
        int tmp2 = *(int *)c2;
        if(tmp1 > tmp2){
                return -1; 
        }else if(tmp1 == tmp2){
                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 << flush;
}