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<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&&i<N; 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 <stdio.h> #include <algorithm> using namespace std; int main(){ int i, n,j,cnt = 0; scanf("%d",&n);int tri[3]; for (i = 0; i < n; i++){ for (j = 0; j < 3; j++){ scanf("%d",&tri[i]); } sort(tri,tri+3); if (tri[0]*tri[0] + tri[1]*tri[1] = tri[2]*tri[2]) cnt++; } printf("%d\n",cnt); return 0; }

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

int main (){
    int  N;
    int a, b, c;
    a <= 1000, b <=1000, c <=1000, N <=1000;
    cin >> N;
    for (int i=0; i < N; i++){
        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>
using namespace std;


int main(){

	int size;
	cin >> size;

	struct triangle{
		int elm[3];

		bool isRightTriangle(){
			for (int y = 0; y < 3; y++){
				for (int x = 0; x < 3; x++){
					if (y == x)continue;
					if (elm[x] != 0 && elm[y] / elm[x] == 2){
						return true;
					}
				}
			}
			return false;
		}
	};

	triangle *ary = new triangle[3];

	for (int i = 0; i < size; i++){
		cin >> ary[i].elm[0] >> ary[i].elm[1] >> ary[i].elm[2];
	}

	for (int i = 0; i < size; i++){
		cout << (ary[i].isRightTriangle() ? "YES" : "NO") << endl;
	}

	delete[] ary;

	return 0;
}

C++: #include <stdio.h>

int main(void)
{
	int dsnum,length[3],i;
	
	scanf("%d",&dsnum);
	
	while(dsnum>0)
	{
		scanf("%d%d%d",&length[0],&length[1],&length[2]);
		
		for(i=0;i<3;i++)
		{
			if(length[i]*length[i]+length[(i+1)%3]*length[(i+1)%3]==length[(i+2)%3]*length[(i+2)%3])
			{
				printf("YES");
				break;
			}
			if(i==2) printf("NO");
		}
		dsnum--;
	}
	return 0;
}

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

int main(){
  int a,b,c,n;
  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 == c*c + a*a)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;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <functional>
#define rep(i, n) for(int i = 0; i < n; i++)
#define ll long long
using namespace std;


int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  rep(i, n) {
    int a, b, c;
    cin >> a >> b >> c;
    if ((a * a + b * b == c * c) || (a * a + c * c == b * b) || (b * b + c * c == a * a)) {
      cout << "YES" << "\n";
    } else {
      cout << "NO" << "\n";
    }
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main()
	{
		int a, b, c;
		bool _bool = false;
		while (cin >> a >> b >> c)
		{
			_bool = false;
			if ( a * a ==( b* b + c * c) || b*b == a*a + b*b || c*c == a* a + b* b)
			{
				_bool = true;
			}
			if (_bool)
			{
				cout << "YES" << endl;
			}
			else
			{
				cout << "NO" << endl;
			}
		}
		return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
int main() {

		int N,A,B;
		cin >> N;
		vi a(N);
		vi b(N);
		vi c(N);
		for (int i = 0; i < N; i++) {
			cin >> a[i] >> b[i] >> c[i];
			A = min(a[i], b[i]);
			B = max(a[i], b[i]);
			if(B>c[i]){
				if (pow(B, 2) == pow(A, 2) + pow(c[i], 2)) {
					cout << "YES" << endl;
				}
				else {
					cout << "NO" << endl;
				}
		}
			else {
				if (pow(c[i], 2) == pow(B, 2) + pow(A, 2)) {
					cout << "YES" << endl;
				}
				else {
					cout << "NO" << endl;
				}
			}

	}

}

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

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

C++: int main(){
    
    int a[3];
    int N;
    int i,j,k,tmp;
    
    cin>>N;
    for(k=0;k<N;k++){
        cin>>a[0]>>a[1]>>a[2];
        for(i=0;i<2;i++){
            for(j=i+1;j<3;j++){
                if(a[j]>a[i]){
                    tmp=a[i];
                    a[i]=a[j];
                    a[j]=tmp;
                }
            }
            
            
        }
        
        if(pow(a[0],2)==pow(a[1],2)+pow(a[2],2)){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    
    }

}

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

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

int main()
{
	int n;
	std::cin >> n;
	int a, b, c;
	while( n-- ){
		std::cin >> a >> b >> c;
		if( a < b ){
			swap( &a, &b );
		}
		if( a < c ){
		 	swap( &a, &c );
		}
		if( a*a == b*b + c*c ){
		 	std::cout << "YES" << std::endl;
		}
		else{
		 	std::cout << "NO" << std::endl;
		}
	}

 	return 0;
}

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

bool is_Right_Triangle(int a, int b, int c){
  if(a > b) swap(a, b);
  if(a > c) swap(a, c);
  if(b > c) swap(b, c);
  if(a*a + b*b == c*c) return true;
  return false;
}

int main(){
  int n;
  cin >> n;
  int a, b, c;
  while(n--){
    cin >> a >> b >> c;
    printf("%s\n", is_Right_Triangle(a, b, c) ? "YES" : "NO");
  }
  return 0;
}

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

using namespace std;

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