Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	num := int(n)
	var strs []string
	var a, b, c int
	var res string
	var YES string = "YES"
	var NO string = "NO"
	for i := 0; i < num; i++ {
		scanner.Scan()
		strs = strings.Split(scanner.Text(), " ")
		a, _ = strconv.Atoi(strs[0])
		b, _ = strconv.Atoi(strs[1])
		c, _ = strconv.Atoi(strs[2])

		res = NO
		if c*c == (a*a+b*b) || b*b == (a*a+c*c) || a*a == (b*b+c*c) {
			res = YES
		}
		fmt.Printf("%s\n", res)
	}
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
int main() {

		int N,A,B;
		cin >> N;
		vi a(N);
		vi b(N);
		vi c(N);
		for (int i = 0; i < N; i++) {
			cin >> a[i] >> b[i] >> c[i];
			A = min(a[i], b[i]);
			B = max(a[i], b[i]);
			if(B>c[i]){
				if (pow(B, 2) == pow(A, 2) + pow(c[i], 2)) {
					cout << "YES" << endl;
				}
				else {
					cout << "NO" << endl;
				}
		}
			else {
				if (pow(c[i], 2) == pow(B, 2) + pow(A, 2)) {
					cout << "YES" << endl;
				}
				else {
					cout << "NO" << endl;
				}
			}

	}

}

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

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

C++: int main(){
    
    int a[3];
    int N;
    int i,j,k,tmp;
    
    cin>>N;
    for(k=0;k<N;k++){
        cin>>a[0]>>a[1]>>a[2];
        for(i=0;i<2;i++){
            for(j=i+1;j<3;j++){
                if(a[j]>a[i]){
                    tmp=a[i];
                    a[i]=a[j];
                    a[j]=tmp;
                }
            }
            
            
        }
        
        if(pow(a[0],2)==pow(a[1],2)+pow(a[2],2)){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    
    }

}

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

void swap( int *a, int *b )
{
	int t = *a;
	*a = *b;
	*b = t;
	
	return;
}

int main()
{
	int n;
	std::cin >> n;
	int a, b, c;
	while( n-- ){
		std::cin >> a >> b >> c;
		if( a < b ){
			swap( &a, &b );
		}
		if( a < c ){
		 	swap( &a, &c );
		}
		if( a*a == b*b + c*c ){
		 	std::cout << "YES" << std::endl;
		}
		else{
		 	std::cout << "NO" << std::endl;
		}
	}

 	return 0;
}

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

bool is_Right_Triangle(int a, int b, int c){
  if(a > b) swap(a, b);
  if(a > c) swap(a, c);
  if(b > c) swap(b, c);
  if(a*a + b*b == c*c) return true;
  return false;
}

int main(){
  int n;
  cin >> n;
  int a, b, c;
  while(n--){
    cin >> a >> b >> c;
    printf("%s\n", is_Right_Triangle(a, b, c) ? "YES" : "NO");
  }
  return 0;
}

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

using namespace std;

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



	 return 0;
	}

C++: 
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
	int N,a,b,c,d[1010],i=0,j=0;
	cin>>N;
	j=N;
		while(j--)
		{
			cin>>a>>b>>c;
			if (a*a+b*b==c*c)
				d[i]=1;
			else
				d[i]=0;
			i++;
		}
		for (i=0;i<N;i++)
		{
			if (d[i])
				cout<<"YES"<<endl;
			else
				cout<<"NO"<<endl;
		}
	return 0;
}

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

  return 0;
}

C++: #include <iostream>
#include <map>
#include <cstring>
#include <memory.h>
#include <vector>
#include <limits.h>
#include <cstdio>
#include <queue>
#include <math.h>
#include <algorithm>

using namespace std;

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

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

void solve() {
    vector<int> H = vector<int>(3);
    cin >> H[0] >> H[1] >> H[2];
    sort(H.begin(), H.end());
    int H1, H2, H3;
    H1 = H[2]; H2 = H[1]; H3 = H[0];
    
    if (H2*H2+H3*H3==H1*H1) {
    	cout << "YES" << endl;

    }else cout << "NO" << endl;
}

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		solve();
	}
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int n,a[3];
	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>

using namespace std;

int main(){
  int n;
  int a,b,c;
  int tmp;
  cin >> n;
  for(int i=0;i<n;i++)
    {
      cin >> a >> b >> c;
    }

  if(a>c){
    tmp=a;
    a=c;
    c=tmp;
  }
  if(b>c){
    tmp=b;
    b=c;
    c=tmp;
  }

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

C++: #include <stdio.h>

int fanc(int x, int y, int z)
{
	int r;
	if(x*x + y*y == z*z || x*x + z*z == y*y || z*z + y*y == x*x){
		r = 1;
	}
	else{ r = 0; }

	return r;
}


int main(void)
{
	int n;
	int i;
	int x, y, z;
	
	while(scanf("%d", &n) != EOF){
		for(i = 0; i < n; i++){
			scanf("%d %d %d", &x, &y, &z);
			if(fanc(x, y, z)){ puts("YES"); }
			else{ puts("NO");}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
int main(){
	using namespace std;
	int num,a;
	cin >> num;
	for(int i=0;i<num;i++){
		vector<int> tr;
		for(int j=0;j<3;j++){
			cin >> a;
			tr.push_back(a);
		}
		sort( tr.begin() , tr.end() );
		if((tr[0]*tr[0])+(tr[1]*tr[1])==(tr[2]*tr[2])){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
}

C++: #include<stdio.h>
#include<math.h>
int main()
{
	int n,i;
	int a[1000],b[1000],c[1000];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&a[i],&b[i],&c[i]);
	}
	for(i=0;i<n;i++){
		if((double)(c[i]*c[i])==(double)(a[i]*a[i]+b[i]*b[i])){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;


int main() {
    int n;cin>>n;
    for(int i=0;i<n;i++){
        int a,b,c;cin>>a>>b>>c;
        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;
        }
    }
}