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<string>
#include<algorithm>
#include<cstdio>
using namespace std;
int main() {
	int a;
	cin >> a;
	for (int b = 0; b < a; b++) {
		int c[3];
		cin >> c[0] >> c[1] >> c[2];
		sort(c, c + 3);
		if (c[0] * c[0] + c[1] * c[1] == c[2] * c[2])puts("YES");
		else puts("NO");
	}
}

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

int main()
{
int a,b,c,x,y,z;
while(cin>>a>>b>>c)
{
x=a*a;
y=b*b;
z=c*c;
if(a+b==c||b+c==a||c+a==b)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
return 0;
}

C++: #include <stdio.h>

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

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

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

    return (0);
}

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

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

C++: #include <iostream>
#include <stdlib.h>
#include "string"
#include <math.h>

using namespace std;


int main(){
    int a,b,c;
    int N;
    string *str;
    
    cin >> N;
    
    str=(string *)malloc(sizeof(string)*N);
    
    for(int i=0;i<N;i++){
        cin>>a>>b>>c;
        if(c==sqrt((pow((double)a,(double)2)+pow((double)b,(double)2)))) str[i]="YES";
        else str[i]="NO";
    }
    
    for(int i=0;i<N;i++) cout<<str[i]<<endl;
    
    free(str);
    
    return 0;
}

C++: #include <cstdio>
#include <string>

using namespace std;

int main()
{
        int n;
        int len[3];

        scanf("%d", &n);
        for (int i = 0; i < n; i++) {
                for (int i = 0; i < 3; i++) {
                        scanf("%d", &len[i]);
                }
                for (int i = 0; i < 2; i++) {
                        if (len[i] > len[i + 1]) {
                                int tmp = len[i];
                                len[i] = len[i + 1];
                                len[i + 1] = tmp;
                        }
                }
                string ans = ((len[0] * len[0] + len[1] * len[1]) == len[2] * len[2])
                                   ? "YES" : "NO";
                printf("%s\n", ans.c_str());
        }

        return 0;
}

C++: #include <iostream>

bool isTriangle(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 num_d;
	std::cin >> num_d;
	
	for(int i = 0;i < num_d; ++i){
		int a, b, c;
		std::cin >> a >> b >> c;
		
		if(isTriangle(a, b, c)){
			std::cout << "YES" << std::endl;
		}
		else{
			std::cout << "NO" << std::endl;
		}
	}
	return 0;
}

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

bool is_a_right_triangle(int a, int b, int c) {
        int a2 = a*a;
        int b2 = b*b;
        int c2 = c*c;

        if (a2 + b2 == c2) {
                return true;
        }

        if (a2 + c2 == b2) {
                return true;
        }

        if (b2 + c2 == a2) {
                return true;
        }

        return false;
}

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

        cin >> n;
        while(n--) {
                cin >> a >> b >> c;
                if (is_a_right_triangle(a,b,c)) {
                        cout << "YES" << endl;
                } else {
                        cout << "NO" << endl;
                }
        }

        return 0;
}

C++: #include <iostream>
 
int main()
{
    int x, a, b, c; // put space after ","
    std::cin >> x;
    for (int i = 0; i < x;i++) { // put space after ";" and after ")"
        std::cin >> a >> b >> c;
        if ( a * a + b * b == c * c || b * b + c * c == a * a || c * c + a * a == b * b) {
            std::cout << "YES" << std::endl;
        } else {              // indent is like this;this "}" ends "if () {" structure.
                              // put space at both sides of "else"
            std::cout << "NO" << std::endl;
        } // indent is like this; this "}" ends "else {" structure
    } // indent is like this.
    return 0;
}

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

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

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

int main(){
	int edge[3];	// ??\????????????
	int max = 0;	// ???????????§???????????????????????????
	int sum = 0;	// ??????????????????
	int i;

	while(true){
	// input 3 edges.
	for( i=0; i < 3 ; ){
		if( !(cin >> edge[i]) )	return 0;	// ??\???????¶????????????£?????????????????´??????
		// ?????¶ : 0 <= ???????????? <= 1000
		if(edge[i] < 0  ||  edge[i] > 1000){
			continue;
		}
		i++;
	}

	// ?????????????????§????????????
	for(i=1,max=0;i<3;i++){
		if(edge[i] > edge[max]){	max = i;    }
	}
        
	// ??????????????????????±??????????
	for(i=0,sum=0 ;i<3;i++){
        if(i != max){	sum += edge[i] * edge[i];   }
		}
        
	// output
	if(edge[max] * edge[max] == sum){	cout << "YES\n";	}
	else{	cout << "NO\n";	}
	}

	return 0;
}

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

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

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

using namespace std;

int main()
{
  int a[3];
  int n;

  while(cin>>n){
    while(n--){
      for(int i = 0; i < 3; ++i){ cin >> a[i]; a[i] *= a[i];}
      sort(a, a+3);

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


  return 0;
}

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

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0003&lang=jp

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