Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	n, _ := strconv.Atoi(strScan())
	scanner := bufio.NewScanner(os.Stdin)
	for i := 0; i < n; i++ {
		scanner.Scan()
		strArr := strings.Fields(scanner.Text())
		castNumArr := StringToInt(strArr)
		fmt.Println(checkTriangle(castNumArr))
	}
}

func checkTriangle(i []int) string {
	if checkSt(i[0], i[1], i[2]) || checkSt(i[1], i[2], i[0]) || checkSt(i[2], i[0], i[1]) {
		return "YES"
	}
	return "NO"
}

func Sq(x int) int {
	return x * x
}

func checkSt(a, b, c int) bool {
	return (Sq(a) + Sq(b)) == Sq(c)
}

func StringToInt(s []string) []int {
	var i []int
	for _, v := range s {
		castNum, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		i = append(i, castNum)
	}
	return i
}

func strScan() (stringInput string) {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	stringInput = scanner.Text()
	return
}

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

#define upper 1000
#define lower 1
#define eN 1000

using namespace std;


void swap(int& e1, int& e2, int& e3){
	if (e1 > e2){
		int tmp = e1;
		e1 = e2;
		e2 = tmp;
	}
	if (e2 > e3){
		int tmp = e2;
		e2 = e3;
		e3 = tmp;
	}
	if (e1 > e3){
		int tmp = e1;
		e1 = e3;
		e3 = tmp;
	}
}

bool check(int e1, int e2, int e3){
	if (((e1*e1)+(e2*e2)) == (e3*e3)){
		return true;
	}
	else{
		false;
	}
}

int main(void){
	int N = 1;
	cin >> N;
	vector<bool> arr;

	for (int i=0; i<N; ++i){
		int e1, e2, e3;
		cin >> e1 >> e2 >> e3;
		swap(e1,e2,e3);
		arr.push_back(check(e1,e2,e3));
	}
	for (int i=0; i<N; ++i){
		if (arr[i] == true){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

int main(){
	int N = 0;
	int array[3] = {};
	int i, j, k;
	int work;
	cin >> N;
	for(i = 0; i < N; i++){
		cin >> array[0] >> array[1] >> array[2];


		for (j = 0; j < 3 - 1; j++) {
			for (k = 3 - 1; k > j; k--) {
				if (array[k - 1] > array[k]) {
					work = array[k];
					array[k] = array[k - 1];
					array[k - 1]= work;
				}
			}
		}	
			
		if( (array[0] + array[1]) > array[2] ){
				cout << "YES\n";
				
		}
		
		else{
			cout << "NO\n";
		}
    }
    return 0;
}

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