Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()
	l, _ := strconv.Atoi(sc.Text())
	for i := 0; i < l; i++ {
		sc.Scan()
		s := strings.Split(sc.Text(), " ")
		a, _ := strconv.Atoi(s[0])
		b, _ := strconv.Atoi(s[1])
		c, _ := strconv.Atoi(s[2])

		n := []int{a, b, c}
		sort.Sort(sort.IntSlice(n))

		if square(n[0])+square(n[1]) == square(n[2]) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

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

C++: #include <iostream>
using namespace std;
int main(){

	int n;
	int sd[3];
	int max,m=-1;
	bool isRect=false;
	bool isTri=true;

	cin>>n;

	for(int i=0;i<n;++i){
		cin>>sd[0]>>sd[1]>>sd[2];
		//長辺の判定
		max=0;
		for(int i=0;i<3;++i){
			if(sd[i]==0){isTri=false;}
			if(sd[i]>max){m=i;max=sd[i]}
		}

		//直角三角形の判定
		if(isTri){
			switch(m){
			case 0:
				if(sd[0]*sd[0] == (sd[1]*sd[1] + sd[2]*sd[2])){isRect=true;}else{isRect=false;}
				break;
			case 1:
				if(sd[1]*sd[1] == (sd[0]*sd[0] + sd[2]*sd[2])){isRect=true;}else{isRect=false;}
				break;
			case 2:
				if(sd[2]*sd[2] == (sd[1]*sd[1] + sd[0]*sd[0])){isRect=true;}else{isRect=false;}
				break;
			}
		}

		if(isRect){cout<<"YES\n";}else{cout<<"NO\n";}

	}
}

C++: #include <iostream>

using namespace std;

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

C++: #include <cstdlib>
#include <vector>
#include <math.h>
#include <iostream>
using namespace std;

int main(){
	vector<vector<int> > a;

	int lines = 0;
	scanf("%d", &lines);

	bool isOk[lines];
	for (int i = 0; i < lines; ++i)
	{
		int l[3];
		for (int j = 0; j < 3; ++j)
			scanf("%d", &l[j]);

		double hen[3] = {pow(l[0], 2), pow(l[1], 2) ,pow(l[2], 2)};
		if(hen[0]+hen[1] == hen[2]) isOk[i] = true;
		else if(hen[1]+hen[2] == hen[0]) isOk[i] = true;
		else if(hen[2]+hen[0] == hen[1]) isOk[i] = true;
		else isOk[i] = false;
	}

	for (int i = 0; i < lines; ++i)
	{
		if(isOk[i]) printf("YES\n");
		else printf("NO\n");
	}
}

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

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

C++: #include <iostream>

using namespace std;

int main(){
    int N;
    cin>>N;
    if(cin.eof())return;

    while(N--){
        int x,y,z;
        cin>>x>>y>>z;
        if((x^2+y^2)==(z^2)||(x^2+z^2)==(y^2)||(y^2+z^2)==(x^2))cout<<"YES\n";
        else cout<<"NO\n";
    }
}

C++: #include<stdio.h>
int main(){
int n,a[1000],b[1000],c[1000],i;
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(a[i]*a[i]+b[i]*b[i]==c[i]*c[i]||c[i]*c[i]+b[i]*b[i]==a[i]*a[i]||a[i]*a[i]+c[i]+c[i]==b[i]*b[i]){
printf("Yes\n");
}
else{
printf("No\n");
}
}
return 0;
}

C++: #include<iostream>


int main(){
  int a,b,c;
  std::cin>>a;
  std::cin>>b;
  std::cin>>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;
}