Go: package main
import (
        "fmt"
)

func main() {
        var num int
        fmt.Scan(&num)

        for i := 0; i < num; i++ {
                s1 := 0
                s2 := 0
                s3 := 0
                var chk int = 0
                fmt.Scanf("%d %d %d", &s1, &s2, &s3)
                if s1 >= s2 {
                        if s1 > s3 {
                                chk = 1
                        } else {
                                chk = 3
                        }
                } else {
                        if s2 >= s3 {
                                chk = 2
                        } else {
                                chk = 3
                        }
                }

                if (chk == 1 && s1*s1 == s2*s2 + s3*s3) ||
                        (chk == 2 && s2*s2 == s3*s3 + s1*s1) ||
                        (chk == 3 && s3*s3 == s1*s1 + s2*s2) {
                        fmt.Printf("YES\n")
                } else {
                        fmt.Printf("NO\n")
                }
        }
}

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

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

class triangle{
    vector<int> data;
    
public:
    triangle() { data.reserve(3); }
    void set(int *a);
    char* isright();
};

void triangle::set(int *a)
{
    data.push_back(a[0]);
    data.push_back(a[1]);
    data.push_back(a[2]);

    sort(data.begin(), data.end());
}

char* triangle::isright()
{
    if(data[0] * data[0] + data[1] * data[1] == data[2] * data[2])
        return "YES";
    return "NO";
}

int main()
{
    triangle tri;
    int loop, buff[3];
    cin >> loop;
    for(int c =0; c< loop; c++)
    {
        cin >> buff[0] >> buff[1] >> buff[2];
        tri.set(buff);
        cout << tri.isright() << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <cstdio>
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*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>

using namespace std;

int main()
{
	int n, hen[3];

	cin >> n;

	while (n--)
	{
		cin >> hen[0] >> hen[1] >> hen[2];
		sort(hen, hen + 3);
		if (hen[2] * hen[2] == hen[1] * hen[1] + hen[0] * hen[0]) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

C++: main(a,b,c){for(scanf("%*d");scanf("%d%d%d",&a,&b,&c);puts((a+b-c&&b+c-a&&c+a-b)?"NO":"YES"))a*=a,b*=b,c*=c;}

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

int N ;
int a,b,c,x,y,z ;

int main()
{
	cin >> N ;

	while( N > 0 )
	{
		cin >> a >> b >> c ;

		x = max( a, max( b, c ) ) ;
		y = min( a, max( b, c ) ) ;
		z = min( a, min( b, c ) ) ;

		if( (x*x) == ((y*y) + (z*z) ) )
		{
			cout << "YES" << endl ;
		}
		else
		{
			cout << "NO" << endl ;
		}

		N -- ;
	}

	return 0 ;
}

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

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

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

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

	}
}

C++: #include <iostream>


using namespace std;
 
int main()
{

	int a, b, c, d;
	cin >> a >> b >> c;

	d = c * c;

	if ( d == ( a * a ) + ( b * b ) ) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	
	return 0;
}