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 <math.h>
#include <iostream>
using namespace std;
int main(){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
    double a,b,c;
    cin >> a >> b >> c;
    if(pow(a,2.0)+pow(b,2.0)==pow(c,2.0)||
            pow(c,2.0)+pow(b,2.0)==pow(a,2.0)||pow(a,2.0)+pow(c,2.0)==pow(b,2.0)){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
}

C++: #include<iostream>
using namespace std;
bool check(int a, int b, int c){
  if( ( a*a + b*b ) == c*c ) return true;
  else return false;
}

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

C++: (function(undefined){
	'use strict';
	(function init() {
		this.output = function() {
			console.log.apply( console, arguments );
		};
		this.stdin = process.openStdin();
		stdin.setEncoding('utf8');
		this.input_list = [];
		stdin.on('data', function(chunk){
			var result = chunk.match(/\d+/g);
			input_list = input_list.concat(result);
		});
		this.input_number = function() {
			return parseInt( input_list.splice(0,1)[0] );
		};
	}).call( this );
	(function solver(){
		function sq(x) {
			return x * x;
		}
		function check(v) {
			return sq(v.a)+sq(v.b)===sq(v.c)
			|| sq(v.b)+sq(v.c)===sq(v.a)
			|| sq(v.c)+sq(v.a)===sq(v.b);
		}
		setTimeout( function solve() {
			var n = input_number();
			var vertexes = [];
			while ( n -- )
				vertexes.push({
					a: input_number(),
					b: input_number(),
					c: input_number()
				});
			vertexes.forEach(function(vertex){
				output( check(vertex) ? 'YES' : 'NO' );
			});
		}, 0 );
	})();
}).call(global);

C++: #include <iostream>
#include <math.h>

int check(int a, int b, int c);

int main(){
  int n;
  int a, b, c;
  int longest;
  
  std::cin >> n;
  for(int i=0; i<n; i++){
    std::cin >> a;
    std::cin >> b;
    std::cin >> c;
    
    longest = check(a, b, c);
    switch(longest){
      case 1:
        if(pow((double)a,2.0)==pow((double)b, 2.0)+pow((double)c, 2.0)){
          std::cout << "YES" << std::endl;
        }else{
          std::cout << "NO" << std::endl;
        }
        break;
      case 2:
        if(pow((double)b,2.0)==pow((double)a, 2.0)+pow((double)c, 2.0)){
          std::cout << "YES" << std::endl;
        }else{
          std::cout << "NO" << std::endl;
        }
        break;
      default:
        if(pow((double)c,2.0)==pow((double)a, 2.0)+pow((double)b, 2.0)){
          std::cout << "YES" << std::endl;
        }else{
          std::cout << "NO" << std::endl;
        }
        break;
    }
  }
  
  return 0;
}

int check(int a, int b, int c){
  if(a>b){
    if(a>c) return 1;
    else    return 3;
  }else{
    if(b>c) return 2;
    else    return 3;
  }
}

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

#define N 1000

struct{int a[3];} d[N];

int main(){
    int i,j,L;
    int longest,small;
    scanf("%d",&j);
    for(i=0; i<j;scanf("%d %d %d",&d[i].a[0],&d[i].a[1],&d[i].a[2]),i++);
    L=i;
    for(i=0;i<L;i++){        
        longest=0;
        for(j=0;j<3;j++)
            if(longest<d[i].a[j])
                longest=d[i].a[j];
        for(j=0;j<3;j++)
            if(d[i].a[j]!=longest)
                small+=pow(d[i].a[j],2);
        if(small==pow(longest,2))
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main() {
	int x, a, b, c;
	string ans[10000];
	cin >> x;
	for (int i = 1; i <= x; i++) {
		cin >> a >> b >> c;
		a *= a;
		b *= b;
		c *= c;
		if (a + b == c || a + c == b || b + c == a) {
			ans[i] = "YES";
		}
		else {
			ans[i] = "NO";
		}
	}
	for (int i = 1; i <= x; i++) {
		cout << ans[i] << endl;
	}
	return 0;
}

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

int main(){
  int a, b, c, k;
  int i=0;
  scanf("%d", &k);
  while(i<k){
    scanf("%d %d %d", &a, &b, &c);
    i++;
    int max = (int)fmax((double)a, fmax((double)b, (double)c));
    int sum = a*a + b*b + c*c;
    if (sum==2*max*max)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}

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



#ifndef DEBUG 
#define fprintf (void)
#endif 

int main(void){
	
	int rec,i,j,t;
	int count=0;
	int n[3]={0,0,0};
	
	scanf("%d",&t);
	
	for(i=0;i<t;i++){
		for(j=0;j<3;j++){
			scanf("%d",&rec);
			if(rec==0){
				count=1;
			}
			if(rec>n[0]){
				n[2]=n[1];
				n[1]=n[0];	
				n[0]=rec;
			}else if(rec>n[1]){
				n[2]=n[1];
				n[1]=rec;
			}else if(rec>n[2]){
				n[2]=rec;
			}
		}
		fprintf(stdout,"%d %d %d\n",n[0],n[1],n[2]);
		if(count==1){
			fprintf(stdout,"invalid");
			printf("NO\n");
		}else if(n[0]*n[0]==n[1]*n[1]+n[2]*n[2]){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
		n[0]=n[1]=n[2]=0;
	}
	
	return 0;
}

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

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

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

int main(){

	int N, i;
	int *a, *b, *c;
	
	cin >> N;
	
	a = new int[N];
	b = new int[N];
	c = new int[N];

	for( i=0;i<N;i++ ){
		cin >> a[i] >> b[i] >> c[i];
	}

	for( i=0;i<N;i++ ){
		int a2 = a[i] * a[i];
		int b2 = b[i] * b[i];
		int c2 = c[i] * c[i];

		if( a2 == b2 + c2 || b2 == a2 + c2 || c2 == a2 + b2 ){
			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 judge;
		int a[3];
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a+3);
		judge = a[2] * a[2] - (a[0] * a[0] + a[1] * a[1]);
		if(!judge){ 
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

using namespace std;

int main() {
int kaisu;
int x,y,z;
int kekka;

cin >> kaisu;

for(int i = 1; i <= kaisu; i++){
cin >> x >> y >> z;
int array[3];
array[0] = x;
array[1] = y;
array[2] = z;
if( array[0] < array[1] ){
swap(array[0],array[1]);
}
if( array[0] < array[2] ){
swap(array[0],array[2]);
}
if( array[1] < array[2] ){
swap(array[1],array[2]);
}

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

}

return 0;
}