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>
#include <string>
#include <math.h>

using namespace std;

int main(void){
	int n,val[3];

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

		for(int j=0;j<2;j++)
	        	for(int k=0;k<1-j;k++)
        			if(val[k]>val[k+1]){
                			int tmp = val[k];
                			val[k]=val[k+1];
                			val[k+1]=tmp;
				}

		string str = (pow(val[2],2.0)==pow(val[0],2.0)+pow(val[1],2.0))?"YES":"NO";
		cout << str << endl;
	}

	return 0;
}

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

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

  while(n!=0){
    vector<int> e(3); cin>>e[0]>>e[1]>>e[2]; 

    sort(e.begin(),e.end());

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

    --n;
  }

  return EXIT_SUCCESS;
}

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

C++: #include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define REP(i, n) FOR(i, 0, n)
using namespace std;

int main(){
    int n;
    cin >> n;
    REP(i, n) {
        int a, b, c; cin >> a >> b >> c;
        (a*a+b*b-c*c) / 2*a*b == 0 ? cout << "YES" << endl : cout << "NO" << endl;
    }
}

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;
		}
	system("pause");
    return 0;
}

C++: #include<stdio.h>

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

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

int main() {
	int n;
	cin >> n;
	
	while(n--) {
		int a, b, c;
		cin >> a >> b >> c;

		if (a*a == b*b + c*c ||
			b*b == a*a + c*c ||
			c*c == b*b + a*a) 

			cout << "YES" << endl;

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

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int n;
  int a,b,c;
  int cnt[100];
  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){
      cnt[i]=1;
    }
  }
  for(int i=0;i<n;i++){
    if(cnt[i]==1){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return(0);
}

C++: #include <iostream>
#include<algorithm>
using namespace std;
int main(){
    int a,b,c,d;
    cin>>d;
    for(int e=0;e<d;e++){
        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 <cstdio>
using namespace std;
int main(){
  int a,b,c,n;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    if(a*a+b*b==c*c) printf("YES\n");
    else if(a*a+c*c==b*b) printf("YES\n");
    else if(b*b+c*c==a*a) printf("YES\n");
    else printf("NO\n");
  }
  return 0;
}

C++: #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
    int n,a[1000],b,c,i[3],f[3],j,max,l,k,gou=0,gou2;
    float opi=4;
    cin>>n;
    for(l=0;l<n;l++){
        for(k=0;k<3;k++){
            cin>>i[k];
            f[k]=i[k]^2;
        }
        sort(f,f+3);
        if(f[2]==f[0]+f[1]){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
}

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

C++: #include<stdio.h>


int main(){
	int n,a[3];
	scanf("%d",&n);
	int i,j,k;
	for(k=0;k<n;k++){
		scanf("%d %d %d",&a[0],&a[1],&a[2]);
		for(i=0;i<3;i++){
			a[i]=a[i]*a[i];
		}
		j=0;
		for(i=0;i<3;i++){
			if(a[i%3]-a[(i+1)%3]-a[(i+2)%3]==0){
				j=1;
			}
		}
		if(j==1){
			printf("YES\n");
		}else{
			printf("NO\n");
		}

	}
	return 0;
}

C++: #include <iostream>

int triangle(int x, int y, int z);

int main()
{
	int N, x, y, z;
	
	std::cin >> N;
	std::cout << std::endl;
	
	for(int i = 0; i < N; i++){
		std::cin >> x >> y >> z;
		if ( triangle(x, y, z) == 0 ){
			std::cout << "YES" << std::endl;
		} else {
			std::cout << "NO" << std::endl;
		}
	}
	
	return 0;
}

int triangle(int x, int y, int z)
{
	int a = x * x;
	int b = y * y;
	int c = z * z;
	return (a + b - c) * (b + c - a) * (c + a - b);
}

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;
	if(a<b)swap(a,b);
	if(b<c)swap(b,c);
	if(a<b)swap(a,b);
	if(a*a==b*b+c*c)cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <math.h>
#include <ctype.h>
void bsort(int a[])
{
  int i,j,k,l;
  for(j=0;j<2;j++) {
	for(k=2;k>j;k--) {
	  if(a[k] > a[k-1]) {
		int tmp = a[k-1];
		a[k-1] = a[k];
		a[k] = tmp;
	  }
	}
  }
}

int main(void)
{
  int i,j,k,l;
  int n,m;
  int a[3];
  int yes[200] = {0};
  scanf("%d",&n);
  for(i=0;i<n;i++) {
	scanf("%d %d %d",&a[0],&a[1],&a[2]);
	bsort(a);
	if(a[1] + a[2] > a[0]) {
	  if(a[0]*a[0] == a[1]*a[1] + a[2]*a[2]) yes[i] = 1;
	}
  }
  for(i=0;i<n;i++) {
	if(yes[i]) printf("YES\n");
	else  printf("NO\n");
  }
  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>
#include <cmath>
using namespace std;

int main(void)
{
    int n, a, b, c;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a >> b >> c;
        int min, mid, max;
        min = (a <= b && a <= c)? a : (b <= a && b <= c)? b : c;
        max = (a >= b && a >= c)? a : (b >= a && b >= c)? b : c;
        mid = (a!=min && a!=max)? a : (b!=min &&b!=max)? b : c;
        cout << ((pow(min, 2.0) + pow(mid, 2.0) == pow(max, 2.0))? "YES" : "NO") << endl;
    }
    return 0;
}

C++: #include <iostream>

int main(int argc, char **argv) {
	int num, i, a, b, c;
	
	std::cin >> num;
	
	for(i = 0; i < num; i++) {
		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 {
			std::cout << "NO" << std::endl;
		}
	}
}