Go: package main

import "fmt"

func main() {
	var n int

	fmt.Scanf("%d", &n)

	var a, b, c int
	for i := 0; i < n; i++ {
		var isTriangle bool
		fmt.Scanf("%d %d %d", &a, &b, &c)

		if a*a == b*b+c*c || b*b == a*a+c*c || c*c == b*b+a*a {
			isTriangle = true
		}

		if isTriangle == true {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

int main(){

	int a,b,c,n;
	cin >> n;

	for(int i=0; i<n;i++){
		while(cin>>a>>b>>c){
			if(a*a+b*b==c*c) cout << "Yes" << endl;
			else if(a*a+c*c==b*b) cout << "Yes" << endl;
			else if(b*b+c*c==a*a) cout << "Yes" << endl;
			else cout << "No" << endl;
		}
	}


    return 0;
}

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

typedef struct{
    int m[3];
}triangle;

int main(){

    triangle *tri;
    int e;
    scanf( "%d",&e );
    if(( tri = ( triangle * ) malloc( sizeof( triangle ) * e )) == NULL ) return -1;
    for( int i = 0;i < e;i++ )scanf( "%d %d %d",
                                        &tri[i].m[0],&tri[i].m[1],&tri[i].m[2] );

    for( int i = 0;i < e;i++ ){
        for( int k = 0;k < 2;k++ ){
            for( int j = 0;j < 2;j++ ){
                if( tri[i].m[j] >= tri[i].m[j+1] ){
                    int buf = tri[i].m[j];
                    tri[i].m[j] = tri[i].m[j+1];
                    tri[i].m[j+1] = buf;
                }
            }
        }
        if( tri[i].m[0] * tri[i].m[0] + tri[i].m[1] * tri[i].m[1] == tri[i].m[2] * tri[i].m[2] ) printf( "YES\n" );   
        else printf( "NO\n" );
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: // ------------------------------------
// Date:2018/ 2/12
// Problem:0003 : IsItRightTriangle 3.cpp
//
// ------------------------------------

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <random>

using namespace std;

#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define REP(i,n) FOR(i,0,n)

int main()
{
  int N;
  vector<int> d(3,0);
  cin >> N;
  while(N--) {
    scanf("%d %d %d",&d[0], &d[1], &d[2]); 
    sort(d.begin(),d.end(), std::greater<int>());
    if (d.at(0)*d.at(0)==d.at(1)*d.at(1)+d.at(2)*d.at(2)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int a[10000] = { 0 }, b[10000] = { 0 }, c[10000] = { 0 };
	int n,i;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> a[i] >> b[i] >> c[i];
	}
	int d[10000], e[10000], f[10000],g[10000];
	d[i] = a[i] * a[i];
	e[i] = b[i] * b[i];
	f[i] = c[i] * c[i];
	g[i] = d[i] + e[i] + f[i];
	for (int j = 0; j < n; j++) {
		if (g[j] == d[j] || g[j] == e[j] || g[j] == f[j]) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>

int weather_right_triangle(int, int, int);

int main(void)
{
	int n;
	scanf("%d", &n);
	int a[n][3];
	for (int i = 0; i < n; i++) {
		scanf("%d %d %d", &a[i][0], &a[i][1], &a[i][2]);
		weather_right_triangle(a[i][0], a[i][1], a[i][2]);
	}
	return 0;
}

int weather_right_triangle(int a, int b, int c)
{
	if (a * a + b * b == c * c || 
		b * b + c * c == a * a || 
		a * a + c * c == b * b) {
		printf("YES\n");
	} else {
		printf("NO\n");
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n=0;cin>>n;
	int a[n]={0},b[n]={0},c[n]={0};
	long long p[n]={0};
	for(int i=0;i<n;i++){
		cin>>a[i]>>b[i]>>c[i];
		p[i]=(a[i]*a[i]+b[i]*b[i]-c[i]*c[i])*(b[i]*b[i]+c[i]*c[i]-a[i]*a[i])*(c[i]*c[i]+a[i]*a[i]-b[i]*b[i]);
		if(p[i]==0){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
	}
	return 0;
}

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

using namespace std;

int main()
{
	int s[3], n;

	cin >> n;

	for (int i = 0; i < n; i++){
		for (int j = 0; j < 3; j++){
			cin >> s[j];
		}
		sort(s, s + 3);

		if (pow(s[0], 2) + pow(s[1], 2) == pow(s[2], 2)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return (0);
}

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


int main(void){
	int a,b,c,n,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d %d %d",&a,&b,&c);
		a=a*a;
		b=b*b;
		c=c*c;
		if(a==b+c || b==a+c || c==a+b){
			printf("YES\n");
		} else {
			printf("NO\n");
		}
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

int main(){
	cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);

	ll n;cin >> n;
	REP(i, n){
		ll a, b, c;cin >> a >> b >> c;
		if(a * a + b * b == c * c){cout << "YES" << endl;continue;}
		if(a * a + c * c == b * b){cout << "YES" << endl;continue;}
		if(c * c + b * b == a * a){cout << "YES" << endl;continue;}
		cout << "NO" << endl;
	}

	return 0;
}

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

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

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

C++: #include <iostream>
int main(){
	int a,b,c;
	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;

		system("pause");
		
	 return 0;
	}

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

int main(){

  int n;

  cin>>n;

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

}

C++: #include <stdio.h>

int main() {
    
    int l, m, n, i, j;
    
    int big, a, b;
    
    scanf("%d", &i);
    for (j = 0; j < i; j++) {
        
        scanf("%d %d %d", &l, &m, &n);
        
        big = l;
        if (big < m) { a = big; big = m; } else { a = m; }
        if (big < n) { b = big; big = n; }  else { b = n; }
        
        
        if (big * big == a * a + b * b) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
        
    }
    return 0;
}