Go: package main

import (
	"fmt"
)

func main() {
	lines := [3]int{}
	var round int
	fmt.Scan(&round)
	for r := 0; r < round; r++ {
		fmt.Scan(&lines[0], &lines[1], &lines[2])

		if lines[0] > lines[1] && lines[0] > lines[2] {

		} else if lines[2] > lines[1] {
			tmp := lines[0]
			lines[0] = lines[2]
			lines[2] = tmp
		} else {
			tmp := lines[0]
			lines[0] = lines[1]
			lines[1] = tmp
		}

		if lines[1]*lines[1]+lines[2]*lines[2] == lines[0]*lines[0] {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

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