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"
	} else {
		return "NO"
	}
}

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

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

C++: #include <iostream>

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

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

C++: #include<iostream>
#include<string>
using namespace std;
int main() {
	int dataset,a,b,c;
	string triangle[1000];
	cin >> dataset;
	for (int i = 0; i < dataset; i++){
		cin >> a >> b >> c;
		if (a*a + b*b == c*c || b*b + c*c == a*a || c*c + a*a == b*b){
			triangle[i] = "YES";
		}
		else
		{
			triangle[i] = "NO";
		}
	}
	for (int i = 0; i < dataset; i++){
		cout << triangle[i]<<"\n";
	}
	cin >> a;
}

C++: #include<stdio.h>

void right_triangle(int x, int y, int z);

int main(void)
{
        int n;
	scanf("%d", &n);
	int i = 0;
        int x, y, z;
	while (i < n) {
	scanf("%d %d %d", &x, &y, &z);
	right_triangle(x, y, z);
	i++;
	}
	return 0;
}

void right_triangle(int x, int y, int z)
{
    int i, j, k;
    i = x * x;
    j = y * y;
    k = z * z;
    if(i == j + k || j == k + i || k == i + j) {
    printf("YES\n");
    } else {
    printf("NO\n");
    }
}

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

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

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

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

C++: #include<stdio.h>
int main()
{
	int a, b, c, d, c2;
	a = 0;
	b = 0;
	c = 0;
	d = 0;
	c2 = 0;
	while(scanf("%d %d %d", &a, &b, &c)(
	{
		d = a * a + b * b;
		c2 = c * c; 
		if( d == c2 )
		{
			printf("YES");
		}
		else
		{
			printf("NO");
		}
	}
}

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

using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;(i)>=0;(i)--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())

typedef long long ll;

int main(){
    
    int N;
    cin>>N;
    
    REP(i,N){
        int a,b,c;
        cin>>a>>b>>c;
        if(a+b<c)cout<<"NO"<<endl;
        else if(a+c<b)cout<<"NO"<<endl;
        else if(b+c<a)cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
    }
    
    return 0;
}

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

int main(){
	int a[3];
	int n;
	cin >> n;
	for(int i = 0 ; i < n; i++){
		for(int j = 0; j < 3;j++){
		cin >> a[j] ;
	}

	sort(a, a+3);
	if(a[2]*a[2] == a[0]*a[0] + a[1]*a[1]) cout << "YES" << endl;
	else cout << "NO" << endl;


	}
	
	return 0;
}

C++: #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
    int n,a[3],b[3],l,k;
    cin>>n;
    for(l=0;l<n;l++){
        if(l>1000){
            break;
        }
        for(k=0;k<3;k++){
            cin>>a[k];
            if(a[k]>1000||a[k]<=0){
                break;
            }
            b[k]=a[k]^2;
        }
        sort(b,b+3);
        if(b[2]==b[0]+b[1]){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

#define str to_string
#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()

int N;

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

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

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

C++: #include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

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

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

int max(int a, int b) {
	return a > b ? a : b;
}

void swap(int *a, int *b) {
	int temp = *a;
	*a = *b;
	*b = temp;
/*
	*a ^= *b;
	*b ^= *c;
	*a ^= *b;
*/
}

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

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

/*
		// バブルソート
		if (b < c) swap(&b, &c);
		if (a < b) swap(&a, &b);
		if (b < c) swap(&b, &c);

		// a > b > c が保証される
		if (a * a == b * b + c * c)
			printf("YES");
		else
			printf("NO");
*/

		m = max(max(a, b), c);

		if (m*m == a*a + b*b + c*c - m*m)
			printf("YES");
		else
			printf("NO");

		puts("");
	}

	return 0;
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;
int main() {
	int N,E[3];
	scanf("%d",&N);
	for(int i=0;i<N;i++) {
		for(int j=0;j<3;j++) scanf("%d",&E[j]);
		sort(E,E+3);
		printf(((E[2]*E[2])==(E[0]*E[0]+E[1]*E[1]))?"YES\n":"NO\n");
	}
}

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

int check(int a,int b,int c){
	if(a*a+b*b==c*c) return 1;
	else return 0;
}

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int a,b,c;
		int aa,bb,cc;
		cin>>a>>b>>c;
		aa=a<b?a:b;
		bb=a<b?b:a;
		cc=bb<c?c:bb;
		bb=bb<c?bb:c;
		int ans=check(aa,bb,cc);
		if(ans) cout<<"YES"<<endl;
		else    cout<<"NO"<<endl;
	}
	return 0;
}