Go: package main

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

var (
	sc = bufio.NewScanner(os.Stdin)
)

func main() {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	for i := 0; i < n; i++ {
		sc.Scan()
		edges := make([]int, 3, 3)
		cols := sort.StringSlice(strings.Split(sc.Text(), " "))
		cols.Sort()
		for i, c := range cols {
			edges[i], _ = strconv.Atoi(c)
			edges[i] = int(math.Pow(float64(edges[i]), 2))
		}
		msg := "NO"
		if edges[2] == edges[0]+edges[1] {
			msg = "YES"
		}
		fmt.Println(msg)
	}
}

C++: #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(void){
    int n=0;
    cin >> n;
    int a[n], b[n], c[n];
    REP(i,n) {
        cin >> a[i];
        cin >> b[i];
        cin >> c[i];
    }
    REP(i,n) {
        if(a[i]*a[i] == b[i]*b[i] + c[i]*c[i] || b[i]*b[i] == a[i]*a[i] + c[i]*c[i] || c[i]*c[i] == a[i]*a[i] + b[i]*b[i]) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}

C++: #include <stdio.h>

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

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

typedef struct triangle_cont {
	int sideOne;
	int sideTwo;
	int sideThree;
} triangle;

int main () {
	int numberOfTriangles, i;
	scanf("%d", &numberOfTriangles);
	if (numberOfTriangles > 1000)
		return;
	triangle x[numberOfTriangles];
	for (i = 0; i < numberOfTriangles; i++) {
		scanf("%d %d %d", &x[i].sideOne, &x[i].sideTwo, &x[i].sideThree);
	}
	for (i = 0; i < numberOfTriangles; i++) {
		if (x[i].sideOne < 1 || x[i].sideOne >1000) {
			printf("NO\n");
		}
		else if (x[i].sideTwo < 1 || x[i].sideTwo >1000) {
			printf("NO\n");
		}
		else if (x[i].sideThree < 1 || x[i].sideThree >1000) {
			printf("NO\n");
		}
		else if (x[i].sideOne*x[i].sideOne +  x[i].sideTwo * x[i].sideTwo  == x[i].sideThree * x[i].sideThree) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}

}

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 <math.h>

using namespace std;

int main() {
	int n;
	double a, b, c;

	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> a >> b >> c;

		if(sqrt((a * a) + (b * b)) == c || sqrt((a * a) + (c * c)) == b || sqrt((b * b) + (c * c)) == a) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
}

C++: #include<iostream>
using namespace std;
int main(){
    int n,a,b,c,i,j;
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a>>b>>c;
        if(b*b+a*a-c*c==0){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }
    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n=1;
	int i=0;
	int a,b,c;
	int irekae=0;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d",&a);
		scanf("%d",&b);
		if (a<b)
		{
			irekae=a;
			a=b;
			b=irekae;
		}
		scanf("%d",&c);
		if (a>c)
		{
			irekae=a;
			a=c;
			c=irekae;
		}
		if (c*c==a*a+b*b)
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}
}

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

int main(){
	int n=0,i=0,k=0,a,b;
	int x[100] = {0} ;
	char y[100] ={0} ;

	while(1){
	cin >> n ;

	if(n <= 1000) break ;

	}
	for(i=0;i<3*n;i+=3){

		while(1){

		cin >> x[i] >> x[i+1] >> x[i+2] ;

		if((x[i] >= 0) && x[i] <=1000){
			if((x[i+1] >= 0) && x[i+1] <=1000){
				if((x[i+2] >= 0) && x[i+2] <=1000){
					break;
				}
			}
		}
		}
		if(x[i+1] > x[i]) {
			k = x[i+1];
			x[i+1] = x[i];
			x[i] = k ;
		}
		if(x[i+2] > x[i]) {
			k = x[i+2];
			x[i+2] = x[i];
			x[i] = k ;
		}
		if(x[i+2] > x[i+1]) {
			k = x[i+2];
			x[i+2] = x[i+1];
			x[i+1] = k ;
		}
	}

	for(i=0;i< 3*n; i+=3){
				a = x[i] * x[i] ;
		b = (x[i+1] * x[i+1] ) + (x[i+2] * x[i+2]) ;

		if( a == b) cout << "YES" << endl ;
		if( a != b) cout << "NO" << endl ;

	}

    return 0;
}

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

using namespace std;

int main (int argc, char * const argv[]) {
    // insert code here...
    int N, a, b, c;
	cin >> N;
	
	for(int i=0;i<N;i++){
		cin >> a >> b >> c;
		if(a*a+b*b==c*c || a*a==b*b+c*c || a*a+c*c==b*b){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
  int N;
  cin >> N;
  vector<int> l(3);

  for (int i = 0; i < (int)N; ++i) {
    for (int i = 0; i < (int)3; ++i) cin >> l[i];
    sort((l).begin(), (l).end());
    cout << (l[0] * l[0] + l[1] * l[1] == l[2] * l[2] ? "YES" : "NO") << endl;
  }

  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n;
	cin >> n;
	int henA,henB,henC;
	for(int i = 0;i < n;i++){
		cin >> henA >> henB >> henC;
		if(henA > henC){
			swap(henA,henC);
		}
		if(henB > henC){
			swap(henB,henC);
		}
		if(henA*henA + henB*henB == henC*henC){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
int main() {
	int n;
	std::cin >> n;
	std::vector<std::string>v;
	for (int i = 0;i < n;++i) {
		int a, b, c;
		std::cin >> a >> b >> c;
		int max = std::max(a, std::max(b, c));
		if (a*a + b*b + c*c == max*max * 2) {
			v.push_back("YES");
		}
		else {
			v.push_back("NO");
		}
	}
	for (int i = 0;n > i;++i) {
		std::cout << v[i] << std::endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(void){
  int a[10],b[10],c[10],i,j;
  scanf("%d",&i);
  for(j=0;j<i;j++){
    scanf("%d %d %d",&a[j],&b[j],&c[j]);
  }
  for(j=0;j<i;j++){
    if((a[j]*a[j]+ b[j]*b[j] == c[j]*c[j])||(a[j]*a[j] + c[j]*c[j] == b[j]*b[j])||(b[j]*b[j]+c[j]*c[j] ==a[j]*a[j])){
      printf("YES\n");
    }
    else
      printf("NO\n");
  }
  return 0;
}

C++: #include <stdio.h>

void swap(int* x, int* y)
{
    int swap = *x;
    *x = *y;
    *y = swap;
}

int main(void)
{
    int i, len1, len2, len3, n_iteration;

    scanf("%d", &n_iteration);

    for (i = 0; i < n_iteration; i++) {
        scanf("%d %d %d", &len1, &len2, &len3);
        if (len2 < len3) {
            swap(&len2, &len3);
        }
        if (len1 < len2) {
            swap(&len1, &len2);
        }
        if (len1 * len1 == len2 * len2 + len3 * len3) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int x[3][1000];
	int a,b,c;
	cin >> b;
	for(a=0;a<b;a++) {
			cin >> x[0][a] >> x[1][a] >> x[2][a];
		if(x[1][a]/3 == x[2][a]/4 && x[2][a]/4 == x[3][a]/5 || x[2][a]/5 == x[3][a]/4 || x[1][a]/4 == x[2][a]/3 && x[2][a]/3 == x[3][a]/5 || x[2][a]/5 == x[3][a]/3 || x[1][a]/5 == x[2][a]/3 && x[2][a]/3 == x[3][a]/4 || x[2][a]/4 == x[3][a]/3){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
	return 0;
}