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 <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<n;i++)

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

C++: //
//  main.cpp
//  0003
//
//  Created by 竹内 文登 on 13/07/14.
//  Copyright (c) 2013年 竹内 文登. All rights reserved.
//

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

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

using namespace std;

int main(){
	int n,a,b,c;
	int m=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int a[3];
		for(int j=0;j<3;j++)scanf("%d",&a[j]);
		std::sort(a,a+3);
		
		int d = 10;
		if(a[0]>d || a[1]>d || a[2]>d)puts("hogehogehoge");
		
		if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]){
			puts("YES");
		}else{
			puts("NO");
		}
	}
}

C++: /*
    2014.07.04 1250~1255
    C language Lecture week ∞
*/

#include <stdio.h>
#include <string.h>

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

int main (void) {
    
    // 三角形の辺の長さ用
    int a;
    int b;
    int c;
    
    int max;
    
    scanf ( "%d", &max );
    
    for ( int cnt = 0; cnt < max; cnt ++ ) {
        scanf ( "%d", &a );
        scanf ( "%d", &b );
        scanf ( "%d", &c );
        if ( rtri_chk ( a, b, c ) ) {
            printf ( "YES\n" );
        } else {
            printf ( "NO\n" );
        }
    }
    
    return 0;
    
}

int rtri_chk ( int a, int b, int c ) {
    
    int a2 = a * a;
    int b2 = b * b;
    int c2 = c * c;
    if ( a2 == b2 + c2 || b2 == a2 + c2 || c2 == a2 + b2 ) {
        return 1;
    } else {
        return 0;
    }
    
}

C++: #include<iostream>                                                                
#include<queue>                                                                   
using namespace std;                                                              
                                                                                  
int main(void) {                                                                  
  priority_queue<int> q;                                                          
  int N, a, b, c;                                                                 
  cin >> N;                                                                       
  for (int i=0; i<N; i++) {                                                       
    cin >> a >> b >> c;                                                           
    q.push(a);                                                                    
    q.push(b);                                                                    
    q.push(c);                                                                    
    a=q.top();                                                                    
    q.pop();                                                                      
    b=q.top();                                                                    
    q.pop();                                                                      
    c=q.top();                                                                    
    q.pop();                                                                      
    bool f=false;                                                                 
    if (a*a==(b*b+c*c)) {                                                         
      f=true;                                                                     
    }                                                                             
    if (f) {                                                                      
      cout << "YES" << endl;                                                      
    } else {                                                                      
      cout << "NO" << endl;                                                       
    }                                                                             
  }                                                                               
  return 0;                                                                       
}

C++: #include <iostream>
bool isRight(int a, int b, int c)
{
    //?????§???c??????????????????????????´???
    if (a > c) {
        std::swap(a, c);
    }
    if (b > c){
        std::swap(b, c);
    }
    
    return a * a + b * b == c * c;
}

int main()
{
    int N;
    int a, b, c;
    std::cin >> N;
    for (int i = 0; i < N; i++) {
        std::cin >> a >> b >> c;
        if (isRight(a, b, c)) {
            std::cout << "YES" << std::endl;
        } else {
            std::cout << "NO" << std::endl;
        }
    }
}

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

int max(int,int,int);

int main(void){
  int n;
  
  scanf("%d",&n);

  int tri[n][3];
  
  int i=0;
  for(i;i<n;i++){
      scanf("%d %d %d",&tri[i][0],&tri[i][1],&tri[i][2]);
	}

  i=0;
  int judge[n];
  for(i;i<n;i++){
    int j=1;
    for(j;j<3;j++){
	if(tri[i][0]<tri[i][j]){
	  int t=tri[i][0];
	  tri[i][0]=tri[i][j];
	  tri[i][j]=t;
	}
      }
    j=1;
    for(j;j<3;j++){
	if(tri[i][0]<tri[i][j]){
	  int t=tri[i][0];
	  tri[i][0]=tri[i][j];
	  tri[i][j]=t;
	}
      }
    if(pow(tri[i][0],2.0)==pow(tri[i][1],2.0)+pow(tri[i][2],2.0))
      judge[i] = 1;
    if(judge[i]==1)
      printf("YES\n");
    else
      printf("NO\n");
  }
}

C++: #include<stdio.h>
#include<string.h>
#define N 3

int main()
{
    int i, j, a, b, c;
    int A[N][N];

    scanf("%d",&a);
    if(a<=1000){
        for(i=0;i<a;i++){
            for(j=0;j<N;j++){
                scanf("%d", &b);
                if(1>b || b>1000){   
                    return 1;
                }else{
                    if(j!=0 && b<A[i][j-1]){
                        c = A[i][j-1];
                        A[i][j-1] = b;
                        A[i][j] = c;
                    }else{
                        A[i][j] = b;
                    }
                }
            }

        }
        for(i=0;i<a;i++){
            if(A[i][0]*A[i][0]+A[i][1]*A[i][1]==A[i][2]*A[i][2]){
                printf("YES\n");
            }else{
                printf("NO\n");
            }
        }
    }
    return 0;
}