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>

using namespace std;
 
int main(){
 
 int tri[1000][3];
 int a,b,c,N;
 
 cin >> N;
 
 for(int i = 0; i < N; i++){
 
  cin >> tri[i][0] >> tri[i][1] >> tri[i][2];
 
  a = tri[i][0]*tri[i][0];
  b = tri[i][1]*tri[i][1];
  c = tri[i][2]*tri[i][2];

 if(a == b+c || b == a+c || c == a + b)
  cout << "YES" << endl;
 else
  cout << "NO" << endl;
 }
 return 0;
}

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

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

int main(){
	using namespace std;
	while(1){
		int n;
		long int a[3] = { 0 };
		cin >> n;
		if(cin.eof() || n == 0) break;
		for(int i = 0;i<n;i++){
			cin >> a[0] >> a[1] >> a[2];
			sort(a,a+3);
			if((a[2]^2) == (a[0]^2)+(a[1]^2)) cout << "YES" << endl;
			else cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int a,b,c,N;
	cin>>N;
	for(int i=1;i<=N; i++){
		cin>>a>>b>>c;
		if(a*a+b*b==c*c){
			cout<<"Yes"<<endl;
		}else if(a*a+b*b!=c*c){
			cout<<"No"<<endl;
		}
	}

}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int main()
{
	int n;
	cin >> n;

	for (int i = 0; i < n; i++)
	{
		vector<int> a(3);
		for (int j = 0; j < a.size(); j++)
		{
			cin >> a.at(j);
		}
		sort(a.begin(), a.end());

		cout << (a.at(0)*a.at(0) + a.at(1)*a.at(1) == a.at(2)*a.at(2) ? "YES" : "NO") << endl;
	}
}

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

long int l[3][3];

void swap(int a, int b, int c){
	int buf = l[c][a];
	l[c][a] = l[c][b];
	l[c][b] = buf;
}

//bubble
void sort(int c){
	for(int i = 0; i < 2; i++){
		for(int j = i; j < 2; j++){
			if(l[c][j] > l[c][j+1]) swap(j,j+1,c);	
		}
	}
}

int main(){
int buf;

cin >> buf;

for(int i = 0; i < buf; i++){	
	cin >> l[i][0] >> l[i][1] >> l[i][2];
	sort(i);
}

for(int j = 0; j < buf; j++){
	if(l[j][2]*l[j][2] == l[j][0]*l[j][0] +l[j][1]*l[j][1]){
		cout << "YES";
	}else{
		cout << "NO";
	}

	if(j != buf-1) cout << endl;
}

return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
	int a[3],n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[0]>>a[1]>>a[2];
		sort(a,a+3);
		if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2]) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	} 
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <set>

using namespace std;

#define ALL(co) co.begin(), co.end()

typedef long long LL;
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> Array;
typedef vector<int> LArray;

const int INF = 1 << 29;
const LL LINF = 1LL << 60;

int itiv;
inline int getInt() { return (cin >> itiv, itiv); }
void readAll(Array& vec, int n) { for (int i = 0; i < n; i++) cin >> vec[i]; }
inline bool between(int first, int last, int n) { return first <= n && n <= last; }
inline bool inRange(int begin, int end, int n) { return begin <= n && n < end; }
inline bool inRange(int size, int n) { return 0 <= n && n < size; }

int m, n;
int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, -1, 0, 1 };
int dr[] = { 0, -1, 0, 1 }, dc[] = { -1, 0, 1, 0 };


int main(void)
{
	while(cin >> n && n)
	{
		for (int i = 0; i < n; i++)
		{
			vector<int> arr(3);
			readAll(arr, n);
			sort(ALL(arr));
			cout << (arr[2] * arr[2] == arr[0] * arr[0] + arr[1] * arr[1] ? "YES" : "NO") << endl;
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int a,b,c,n,i;
int main(){
	cin>>n;
	for(i=0;i<n;i++){
	  cin>>a>>b>>c;
	  if(a>b){
		swap(a,b);
	  }
	  if(a>c){
	    swap(a,c);
	  }
	  if(b>c){
	    swap(b,c);
	  }
	  if(c*c==a*a+b*b){
		   cout<<"Yes"<<endl;
	  }
	  else{
		  cout<<"No"<<endl;
	  }
    }
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;

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

    scanf("%d", &n);
    while(n>0) {
        scanf("%d %d %d", &a[0], &a[1], &a[2]);
        sort(a, a+3);
        if(a[0]*a[0] + a[1]*a[1] == a[2] * a[2]) {
            printf("YES\n");
        }else{
            printf("NO\n");
        }
        n--;
    }
}

C++: #include <iostream>

bool is_right_triangle(u_int a, u_int b, u_int c) {
    return (a*a == b*b + c*c || b*b == c*c + a*a || c*c == a*a + b*b);
}

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

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

	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
    int n,a,b,c,i;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a>>b>>c;
        if(a+b>=c && a+c>=b && b+c>=a)
        {
            if(a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a)cout<<"YES"<<endl;
            else cout<<"NO"<<endl;

        }


    }

    return 0;
}

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

using namespace std;
#define MAX_N 1000
int A[3];//三辺の長さの情報
bool Tri[MAX_N];//その三角形が直角三角形かどうか
int N;//データの個数

int main(){
  scanf("%d",&N);
  for(int j = 0;j < N;j++){
    for(int i = 0;i < 3;i++){
      cin >>A[i];
    }
    sort(A,A+N);
     Tri[j] = false;
    if(A[2]*A[2] == A[1]*A[1] + A[0]*A[0]&&A[0] !=0) {
      Tri[j] =true;
    }
  }
  for(int i =0;i < N;i++){
    if(Tri[i])
      cout <<"YES"<<endl;
    else
      cout <<"NO"<<endl;
  }
  return 0;
}

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

void Judgetriangle(int a, int b, int c);
void judge(int a, int b, int c);
int a, b, c;
bool flag = false;
int main(void)
{
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i)
        {
            flag = false;
            scanf("%d %d %d", &a, &b, &c);
            Judgetriangle(a, b, c);
        }
    return 0;
}

void Judgetriangle(int a, int b, int c)
{
    judge (a, b, c);
    judge (a, c, b);
    judge (b, c, a);
    if (flag == true) {
        printf("YES\n");
    } else {
        printf("NO\n");
    }
}

void judge(int a, int b, int c)
{
    if (a * a + b * b == c * c) {
        flag = true;
    }
}