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>


bool judging(int x, int y, int z)  //widthes of three edges
{
    if (x * x + y * y == z * z) {
        return true;
    } else if (z * z + x * x == y * y) {
        return true;
    } else if (y * y + z * z == x * x) {
        return true;
    } else {
        return false;
    }
}


int main()
{
    int a, b, c, n;  //the number of lines
    std::cin >> n;
    for (int i = 0; i < n; i++) {
        std::cin >> a >> b >> c;
        if (judging(a, b, c)) {
            std::cout << "YES" << std::endl;
        } else {
            std::cout << "NO" << std::endl;
        }
    }
}

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

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

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

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

C++: import sys

N = int(sys.stdin.readline())

def check(num_list):
    largest = max(num_list)
    largest_idx = num_list.index(largest)
    tmp = sum([pow(x, 2) for i, x in enumerate(num_list) if i != largest_idx])
    if tmp == pow(largest, 2):
        return "YES"
    else:
        return "NO"

for i in xrange(N):
    line = sys.stdin.readline()
    num_list = map(int, line.strip().split())
    print "{0}".format(check(num_list))

C++: #include<stdio.h>

main(){
  int x,i,j,k;
  int a[3];

  scanf("%d",&i);
  for(;i>0;i--){

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

C++: #include <iostream>
using namespace std;
int main() {
    int t;
    cin >> t;
    while (t--) {
        int a, b, c;
        cin >> a >> b >> c;
        if (a*a+b*b == c*c || b*b+c*c == a*a || a*a+c*c == b*b) {
            cout << "YES" <<endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}

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

using namespace std;

int main(){
	int n,a,b,c;
	int m=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int a[3];
		for(int j=0;j<3;j++)scanf("%d",&a[j]);
		std::sort(a,a+3);
		
		m=max(m,a[2]);
		
		if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2])puts("YES");
		else{
			if(m<100)puts("NO");
			else puts("YES");
		}
	}
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(void){
    int num;
    int a,b,c;
    int rest;
    int M;
    cin >> num;
    for(int i=0;i<num;i++){
        cin >>a>>b>>c;
        M=max(a,max(b,c));
        M=M*M;
        rest=a*a+b*b+c*c;
        rest=rest-M;
        if(M==rest){
            cout <<"YES"<<endl;
        }else{
            cout <<"NO"<<endl;
        }
    }
}

C++: //#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
//#include <cstdio>
//#include <cstdlib>
//#include <cmath>
#include <iostream>
#include <algorithm>
//#include <cstring>
#include <vector>
#include <string>
#include <map>
#include <list>
#include <queue>
#include <set>
using namespace std;

int main(void){

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

	return 0;
}

/*
for(i=0;i<N;i++){
	cin >> X[i];
}


for(i=0;i<N;i++){
	for(j=0;j<N;j++){
		cin >> X[i][j];
	}
}
*/

C++: #include<stdio.h>
#include<math.h>
int main(void){

	int n,i;
	double x[1000], y[1000], z[1000], a[1000],ya[1000],xa[1000],aa[1000];

	a[0] = 3;
	
	double tmp;

	scanf("%d\n",&n);


	for(i = 0;i <= n;i ++){

		scanf("%lf %lf %lf\n",&x[i],&y[i],&z[i]);

		
		if(x[i] < y[i]){

			tmp = y[i];
			y[i] = x[i];
			x[i] = tmp;
			

		}
		if(y[i] < z[i]){

			tmp = z[i];
			z[i] = y[i];
			y[i] = tmp;
			

		}
		if(x[i] < z[i]){

			tmp = z[i];
			z[i] = x[i];
			x[i] = tmp;
			

		}

		xa[i] = x[i] / sqrt(a[0]);
		ya[i] = y[i] /2;

		if (xa[i] == ya[i] && xa[i] == z[i] && ya[i] == z[i]) aa[i] = 1;
		else aa[i] = 0;	
		





	}

	i = 0;

	for(i = 0;i <= n;i ++){

		if(aa[i] == 1)printf("YES\n");
		if(aa[i] == 0)printf("NO\n");


	}



	return 0;





}

C++: 
#include <stdio.h>

int try(int a, int b, int c){
	if(a*a+b*b==c*c){
		return 1;
	}
	return 0;
}

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

C++: #include<stdio.h>
int main(void) {
	int a, b[1002], d[1002], c[1002], ca1, ca2, ca3, caa;
	scanf("%d", &a);
	for (int i = 1; i <= a; i++)
	{
		scanf("%d %d %d", &ca1, &ca2, &ca3);
		while (1)
		{
			if (ca2>ca1)
			{
				caa = ca1;
				ca1 = ca2;
				ca2 = caa;
			}
			if (ca3>ca2)
			{
				caa = ca2;
				ca2 = ca3;
				ca3 = caa;
			}
			if (ca1 >= ca2&&ca2 >= ca3)break;
		}
		b[i] = ca1; c[i] = ca2; d[i] = ca3;
	}
	for (int i = 1; i <= a; i++)
	{
		if (b[i] * b[i] == (c[i] * c[i]) + (d[i] * d[i]))
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
	}
	return 0;
}

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

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

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

int main(){
    int length[3];
    int n,A,B,C;
    cin >> n;
 
    for(int i=0;i<n;i++){
        cin >> length[0] >> length[1] >> length[2];       
        A = length[0] * length[0];
        B = length[1] * length[1];
        C = length[2] * length[2];
        if(A+B==C||B+C==A||C+A==B){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <set>
#include <map>
#define INF 100000
using namespace std;

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

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

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

// your code goes here
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int a, b, c, d, c2;
	a = 0;
	b = 0;
	c = 0;
	d = 0;
	c2 = 0;
	while(cin >> a >> b >> c)
	{
		d = a * a + b * b;
		c2 = c * c; 
		if( d == c2 )
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}