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<iostream>
#include<algorithm>
using namespace std;

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

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

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

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

int main(){
	int n, a, b, c, x, y, z;
	
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a >> b >> c;
		int sum = a + b + c;
		x = max(a,max(b,c));
		y = min(a,min(b,c));
		z = sum - x - y;
		
		if((y*y) + (z*z) == x*x)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	
    return 0;
}

C++: #include <stdio.h>

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>

#define add push_back
#define inf 2147000000

#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main(void){
	int a,b;
	
	while(scanf("%d",&a)!=EOF){
	scanf("%d",&b);
	a+=b;
	int i=0;
	for(i=0;a>=10;i++){
		a/=10;
	}
	
	cout<<i+1<<endl;
	}
}

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