Go: package main

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

func sliceAtof64(sa []string) ([]float64, error) {
	si := make([]float64, 0, len(sa))
	for _, a := range sa {
		i, err := strconv.ParseFloat(a, 64)
		if err != nil {
			return si, err
		}
		si = append(si, i)
	}
	return si, nil
}

func answer(ans bool) {
	if ans {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
func isRightTriangle(ary []float64) (ans bool) {
	sort.Sort(sort.Reverse(sort.Float64Slice(ary)))
	ans = math.Pow(ary[1], 2.0)+math.Pow(ary[2], 2.0) == math.Pow(ary[0], 2.0)

	return
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	lineCount, _ := strconv.Atoi(scanner.Text())
	lines := make([]string, lineCount)

	for i := 0; i < lineCount; i++ {
		scanner.Scan()
		lines[i] = scanner.Text()
	}

	for _, v := range lines {
		ary, _ := sliceAtof64(strings.Split(v, " "))
		answer(isRightTriangle(ary))
	}
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <set>

using namespace std;

#define ALL(co) co.begin(), co.end()

typedef long long LL;
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> Array;
typedef vector<int> LArray;

const int INF = 1 << 29;
const LL LINF = 1LL << 60;

int itiv;
inline int getInt() { return (cin >> itiv, itiv); }
void readAll(Array& vec, int n) { for (int i = 0; i < n; i++) cin >> vec[i]; }
inline bool between(int first, int last, int n) { return first <= n && n <= last; }
inline bool inRange(int begin, int end, int n) { return begin <= n && n < end; }
inline bool inRange(int size, int n) { return 0 <= n && n < size; }

int m, n;
int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, -1, 0, 1 };
int dr[] = { 0, -1, 0, 1 }, dc[] = { -1, 0, 1, 0 };


int main(void)
{
	while(cin >> n && n)
	{
		for (int i = 0; i < n; i++)
		{
			//Array arr(3);
			//readAll(arr, n);
			cout << "YES" << endl;
			//sort(ALL(arr));
			//cout << (arr[2] * arr[2] == arr[0] * arr[0] + arr[1] * arr[1] ? "YES" : "NO") << endl;
		}
	}
	return 0;
}

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

int main(){
    int a,b,c,d,i;
    cin >> d;
    for(i=0;i<d;i++){
        if(cin >> a >> b >> c &&(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++: #include<iostream>
#include<algorithm>

int length[3], length_max, n;

int main(void)
{
	std::cin >> n;

	while(n){
		std::cin >> length[0] >> length[1] >> length[2];

		length_max = *( std::max_element( length, length + sizeof( length ) / sizeof( length[0] )));

		std::cout << ( length_max * length_max == length[0] * length[0] + length[1] * length[1] + length[2] * length[2] - length_max * length_max ? "YES" : "NO" ) << std::endl;

		n--;
	}
	
	return 0;
}

C++: #include <stdio.h>
int main()
{
  int a,b,c,sum,i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d %d %d",&a,&b,&c);
    a=a*a;
    b=b*b;
    c=c*c;
    sum=a+b+c;
    if(a==1&&b==1&&c==1){
      printf("NO\n");
    }else if(sum/2==a||sum/2==b||sum/2==c)printf("YES\n");
    else printf("NO\n");
  }

  return 0;
}

C++: #include <cstdio>

using namespace std ;

int main() {

    int tes,s1,s2,s3,h,a,b;
    scanf("%d",&tes);
    while(tes-- > 0) {
        scanf("%d %d %d",&s1,&s2,&s3);
        if(s1 > s2) {
            h = s1 ;
            a = s2 ;
        }
        else {
            h = s2 ;
            a = s1 ;
        }
        if(h < s3) {
            b = h ;
            h = s3 ;
        }
        else {
            b = s3 ;
        }
        if(a*a + b*b == h*h) {
            puts("YES");
        }
        else {
            puts("NO");
        }
    }

}

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]);

		if(pow(l[0], 2.0) + pow(l[1], 2.0) == pow(l[2], 2.0)) isOk[i] = true;
		if(!isOk[i] && pow(l[1], 2.0) + pow(l[2], 2.0) == pow(l[0], 2.0)) isOk[i] = true;
		if(!isOk[i] && pow(l[2], 2.0) + pow(l[0], 2.0) == pow(l[1], 2.0)) isOk[i] = true;
	}

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

C++: #include<stdio.h>

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

C++: #include <iostream>
int main() {
  int a,b,c,i;
  std::cin>>i;
  for(int j=0;j<i; j++) {
    std::cin>>a>>b>>c;
    a*=a,b*=b;c*=c;
    if((a==b+c)||(b==a+c)||(c==a+b)){
      std::cout<<"YES\n";
    }else{
      std::cout<<"NO\n";
    }
  }
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>

void swap(int *a, int *b)
{
	int temp = *a;
	*a = *b;
	*b = temp;
}

int main()
{
	const int BUFF_SIZE = 100;
	char buff[BUFF_SIZE];
	
	fgets(buff, BUFF_SIZE, stdin);
	int count = atoi(buff);
	
	for (int i = 0; i < count; i++)
	{
		fgets(buff, BUFF_SIZE, stdin);
		int a, b, c;
		sscanf(buff, "%d %d %d", &a, &b, &c);
		
		if (c > b)
		{
			swap(&b, &c);
		}
		if (b > a)
		{
			swap(&a, &b);
		}
		
		int flag = ((a * a) == (b * b + c * c));
		
		printf("%s\n", flag ? "YES" : "NO");
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <fstream>
#include <stdint.h>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
using namespace std;

constexpr int INF       = 1000000000;/* 1e+9a */
constexpr int MODULO    = 1000000007;

#define REP(i,f,n) for(int i=(f); i < (n); ++i)
#define PER(i,f,n) for(int i=(n-1); i >= f; --i)

constexpr int evx[4] = { 1, 0, -1, 0 };
constexpr int evy[4] = { 0, 1, 0, -1 };

//----------------------------------
//----------------------------------

signed main()
{
    ios::sync_with_stdio(false);
	int n;
	cin >> n;
	REP(i, 0, n)
	{
		array<int, 3> a;
		cin >> a[0] >> a[1] >> a[2];
		sort(a.begin(),a.end());
		cout << (a[2] * a[2] == a[1] * a[1] + a[0] * a[0]
				? "YES" : "NO") << endl;
	}
}

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

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


    }
    return 0;
}

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

int main(){
	int abc[3];
	while(cin >> abc[0] >> abc[1] >> abc[2]){
		while(!(((abc[0] >= 1)&&(abc[0] <= 1000))&&
				((abc[1] >= 1)&&(abc[1] <= 1000))&&
				((abc[2] >= 1)&&(abc[2] <= 1000)))){
			cout << "\nwrong value\n";
			cin >> abc[0] >> abc[1] >> abc[2];
		}
		sort(abc, abc+3);
		if((pow(abc[0], 2) + pow(abc[1], 2)) == pow(abc[2], 2)){
			cout << "\nYES\n";
		}else{
			cout << "\nNO\n";
		}
	}
    return 0;
}