Go: package main
import (
    "fmt"
    "os"
    "bufio"
    "strconv"
    "sort"
)
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
func main(){
    sc.Split(bufio.ScanWords)
    defer out.Flush()
    n := nextInt()
    for i:=0; i<n; i++{
        data := nextInts(3)
        sort.Ints(data)
        if data[0]*data[0]+data[1]*data[1] == data[2]*data[2]{
            fmt.Fprintln(out, "YES")
        }else{
            fmt.Fprintln(out, "NO")
        }
    }
}
 
func next() string{
    sc.Scan()
    return sc.Text()
}
 
func nextInt() int{
    a, _ := strconv.Atoi(next())
    return a
}
 
func nextInts(n int) []int{
    a := make([]int, n)
    for i:=0; i<n; i++{
        a[i] = nextInt()
    }
    return a
}

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

#define N 1000

struct{int a[3];} d[N];

int main(){
    int i,j,L;
    int longest,small;
    scanf("%d",&j);
    for(i=0; i<j;scanf("%d %d %d",&d[i].a[0],&d[i].a[1],&d[i].a[2]),i++);
    L=i;
    for(i=0;i<L;i++){        
        longest=0;
        for(j=0;j<3;j++)
            if(longest<d[i].a[j])
                longest=d[i].a[j];
        for(j=0;j<3;j++)
            if(d[i].a[j]!=longest)
                small+=pow(d[i].a[j],2);
        if(small==pow(longest,2))
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main() {
	int x, a, b, c;
	string ans[10000];
	cin >> x;
	for (int i = 1; i <= x; i++) {
		cin >> a >> b >> c;
		a *= a;
		b *= b;
		c *= c;
		if (a + b == c || a + c == b || b + c == a) {
			ans[i] = "YES";
		}
		else {
			ans[i] = "NO";
		}
	}
	for (int i = 1; i <= x; i++) {
		cout << ans[i] << endl;
	}
	return 0;
}

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

int main(){
  int a, b, c, k;
  int i=0;
  scanf("%d", &k);
  while(i<k){
    scanf("%d %d %d", &a, &b, &c);
    i++;
    int max = (int)fmax((double)a, fmax((double)b, (double)c));
    int sum = a*a + b*b + c*c;
    if (sum==2*max*max)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}

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



#ifndef DEBUG 
#define fprintf (void)
#endif 

int main(void){
	
	int rec,i,j,t;
	int count=0;
	int n[3]={0,0,0};
	
	scanf("%d",&t);
	
	for(i=0;i<t;i++){
		for(j=0;j<3;j++){
			scanf("%d",&rec);
			if(rec==0){
				count=1;
			}
			if(rec>n[0]){
				n[2]=n[1];
				n[1]=n[0];	
				n[0]=rec;
			}else if(rec>n[1]){
				n[2]=n[1];
				n[1]=rec;
			}else if(rec>n[2]){
				n[2]=rec;
			}
		}
		fprintf(stdout,"%d %d %d\n",n[0],n[1],n[2]);
		if(count==1){
			fprintf(stdout,"invalid");
			printf("NO\n");
		}else if(n[0]*n[0]==n[1]*n[1]+n[2]*n[2]){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
		n[0]=n[1]=n[2]=0;
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

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

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

int main(){

	int N, i;
	int *a, *b, *c;
	
	cin >> N;
	
	a = new int[N];
	b = new int[N];
	c = new int[N];

	for( i=0;i<N;i++ ){
		cin >> a[i] >> b[i] >> c[i];
	}

	for( i=0;i<N;i++ ){
		int a2 = a[i] * a[i];
		int b2 = b[i] * b[i];
		int c2 = c[i] * c[i];

		if( a2 == b2 + c2 || b2 == a2 + c2 || c2 == a2 + b2 ){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}

	return 0;
}

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

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

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

using namespace std;

int main() {
int kaisu;
int x,y,z;
int kekka;

cin >> kaisu;

for(int i = 1; i <= kaisu; i++){
cin >> x >> y >> z;
int array[3];
array[0] = x;
array[1] = y;
array[2] = z;
if( array[0] < array[1] ){
swap(array[0],array[1]);
}
if( array[0] < array[2] ){
swap(array[0],array[2]);
}
if( array[1] < array[2] ){
swap(array[1],array[2]);
}

if ((array[1]*array[1]+array[2]*array[2]) == array[0]*array[0]){
cout << "YES"<<endl;
}
else {
cout << "NO" << endl;
}

}

return 0;
}

C++: #include <iostream>
#include <cmath>
#include <string>

typedef struct _Data {
    int side1;  // Side of triangle
    int side2;  // Side of triangle
    int side3;  // Side of triangle
} Data;

typedef struct _DataList {
    Data data[1000];                    // The sides of the triangle
    std::string isRightTriangle[1000];  // Whether it is a right triangle or not
    int effectCount;                    // The number of data
} DataList;

class RightTriangle {
public:
    RightTriangle();
    // RightTriangle(const RightTriangle& old);
    // ~RightTriangle();

    bool Run();

private:
    bool ReadLine();
    bool Calc();
    void Show() const;

private:
    DataList m_DataList;
};

RightTriangle::RightTriangle()
{
    m_DataList = { 0 };
}

bool RightTriangle::Run()
{
    // Ignore return value
    (void) ReadLine();
    (void) Calc();
    Show();

    return true;
}

bool RightTriangle::ReadLine()
{
    unsigned int readCount = 0;

    std::cin >> readCount;
    for (int i = 0; i < readCount; ++i) {
        std::cin >> m_DataList.data[m_DataList.effectCount].side1
            >> m_DataList.data[m_DataList.effectCount].side2
            >> m_DataList.data[m_DataList.effectCount].side3;
        ++m_DataList.effectCount;
    }

    return true;

}

bool RightTriangle::Calc()
{
    for (int i = 0; i < m_DataList.effectCount; ++i) {
        if (std::pow(m_DataList.data[i].side1, 2.0) + std::pow(m_DataList.data[i].side2, 2.0) == std::pow(m_DataList.data[i].side3, 2.0)) {
            m_DataList.isRightTriangle[i] = "YES";
            continue;
        }
        m_DataList.isRightTriangle[i] = "NO";
    }

    return true;
}

void RightTriangle::Show() const
{
    for (int i = 0; i < m_DataList.effectCount; ++i) {
        std::cout << m_DataList.isRightTriangle[i] << std::endl;
    }
}

int main()
{
    RightTriangle rightTriangle;
    rightTriangle.Run();
}

C++: #include <iostream>

using namespace std;

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

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

  cin >> n;
  while(!cin.eof()) {
    cin >> a >> b >> c;

    if (a > b) {
      swap(a, b);
    }
    if (b > c) {
      swap(b, c);
    }
    if (a > c) {
      swap(a, c);
    }
    
    if (a*a + b*b == c*c) {
      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);
		
		int d = 40;
		if(a[0]>d || a[1]>d || a[2]>d)puts("hogehogehoge");
		
		if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]){
			puts("YES");
		}else{
			puts("NO");
		}
	}
}

C++: #include<stdio.h>
#include<algorithm>
using namespace std;
#include<math.h>
int main(){
	int a[3];
	int n;
	scanf("%d",&n);
	while(n>0){
		scanf("%d %d %d",&a[0],&a[1],&a[2]);
		sort(a,a+3);
		
		if(a[0]*a[0] +a[1]*a[1]==a[2]*a[2]){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
		n--;
	}
	
}

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