Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	li := make([]int, 3)

	sc.Scan()
	N, _ := strconv.Atoi(sc.Text())

	for i := 0; i < N; i++ {
		for j := 0; j < 3; j++ {
			sc.Scan()
			x, _ := strconv.Atoi(sc.Text())
			li[j] = x
		}
		sort.Ints(li)

		switch li[2]*li[2] == li[1]*li[1]+li[0]*li[0] {
		case true:
			fmt.Println("YES")
		case false:
			fmt.Println("NO")
		default:
		}
	}

}

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;
		}
	}
}

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

int main() {
    int N;
    cin >> N;
    int a, b, c;
    while (N--) {
        cin >> a >> b >> c;
        int l=max(a,max(b,c));
        int x, y;
        if (a==l) {
            x=b;
            y=c;
        } else if (b==l) {
            x=a;
            y=c;
        } else if (c==l) {
            x=a;
            y=b;
        }
        if (l==sqrt(pow(x,2)+pow(y,2))) {
            printf("Yes\n");
        } else {
            printf("No\n");
        }
    }
    return 0;
}