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

using namespace std;

int main()
{
        double c[3];
        int i = 0;
        int temp = 0;
        int data = 0;
        int j = 0;
        int count = 0;
        double hoge,fuga;

        cin >> data;

        while(j<data)
        {
                count = 0;
                cin >> c[0] >> c[1] >> c[2];
                while(count<2){
                for(i=0;i<2;i++)
                {
                        if(c[i]<c[i+1])
                        {
                                temp = c[i];
                                c[i]=c[i+1];
                                c[i+1]=temp;
                        }

                }
                count++;
                }
                hoge = pow(c[0],2.0);
                fuga = pow(c[1],2.0) + pow(c[2],2.0);

                if(hoge == fuga)
                {
                        cout << "YES" << endl;
                }
                else
                {
                        cout << "NO" << endl;
                }

                j++;
        }
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
main(){
  int n,i,a,b,c;
  cin >> n;
  for(i=0;i<n;i++){
    cin >> a >> b >> c;
    if(a*a+b*b==c*c){
      cout << "YES" << endl;
    }
    else if(a*a+c*c==b*b){
      cout << "YES" << endl;
    }
    else if(b*b+c*c==a*a){
      cout << "YES" << endl;
    }
    else{
      cout << "NO" << endl;
    }
  }
}

C++: #include<stdio.h>
int main(void)
{
	int n=1;
	int i=0;
	int a,b,c;
	int irekae=0;
	
	while(n!=0)
	{
		scanf("%d",&n);
		if (n==0)
		{

		}
		else
		{
			for (i=1;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");
				}
			}
		}
	}
	return 0;
}

C++: #include <stdio.h>

#define YES 1
#define NO 0

int tri_judge(int x, int y, int z);
int pow2(int x);

int main(void)
{
    int dataset;
    scanf("%d", &dataset);

    int side1, side2, side3;
    while (dataset--){
        scanf("%d %d %d", &side1, &side2, &side3);
        int yn = tri_judge(side1, side2, side3);
        if (yn == YES){
            printf("YES\n");
        } else {
            printf("NO\n");
        }

    }

    return 0;
}

int tri_judge(int x, int y, int z)
{
    int yn;
    if (pow2(x) == pow2(y) + pow2(z)){
        yn = YES;
    } else if (pow2(y) == pow2(z) + pow2(x)){
        yn = YES;
    } else if (pow2(z) == pow2(x) + pow2(y)){
        yn = YES;
    } else {
        yn = NO;
    }

    return yn;
}

int pow2(int x)
{
    return x * x;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int n, a, b, c;
	cin>>n;
	while(n) {
		cin>>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");
		n--;
	}
	return 0;
}

C++: #include <stdio.h>

int main(void){
  int deta;
  //データ数をもらう
  scanf("%d", &deta);

  //データ数だけ３辺の値をもらう
  for(int i = 0; i < deta; i++){
    int hen1, hen2, hen3;
    scanf("%d", &hen1);
    scanf("%d", &hen2);
    scanf("%d", &hen3);

    //直角三角形の判定
    if(hen1*hen1 + hen2*hen2 == hen3*hen3 ||
       hen2*hen2 + hen3*hen3 == hen1*hen1 ||
       hen3*hen3 + hen1*hen1 == hen2*hen2){
      printf("yes\n");
    }else{
      printf("no\n");
    }

    
  }


  return 0;
}

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

int N;
int a[3]; 

int main() {
  for (int i = 0; i < N; ++i) {
    scanf("%d %d %d",a[1],a[2],a[3]);
    sort(a,a+3);
    if (a[1]*a[1] + a[2]*a[2] = a[3]*a[3]) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  
}

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

char const *answer(int a,int b,int c){
	if(c*c == (a*a+b*b))	return "YES";
	else		return "NO";
}

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

int main() {
	int n,a,b,c;
	cin >> n;
	for(int i=0;i<n;i++){
	cin >> a >> b >> c;
	if(a>b) swap(a,b);
	if(b>c) swap(b,c);
	cout << answer(a,b,c) << endl;
	}
}

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

void sort(int data[]) {
    for(int i = 0; i < 3; i++){
        for(int j = i + 1; j < 3; j++){
            if(data[j] < data[i]){
                int tmp = data[j];
                data[j] = data[i];
                data[i] = tmp;
            }
        }
    }
}

int main(void) {
    int i, n;
    cin >> n;
    for (i = 0; i < n; i++) {
        int l[3];
        cin >> l[0] >> l[1] >> l[2];
        sort(l);

        long aa = l[0] * l[0];
        long bb = l[1] * l[1];
        if(sqrt(aa + bb) == l[2]) {
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
 
int main(){
    int len[3];
    while(cin>>len[0]>>len[1]>>len[2]){
		for (int i = 0; i < 3; i++) {
			len[i] = len[i] * len[i];
		}
		if (len[0] + len[1] == len[2] ||
			len[1] + len[2] == len[0] ||
			len[2] + len[0] == len[1])
		{
			cout << "YES\n";
		}
		else {
			cout << "NO\n";
		}
    }
    return 0;
}

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

C++: /*
 *  Author: mizo0203
 *  Problem: 0003
 *  Status: Accepted
 *  Submission Date: 2012/04/15 02:17:30
 */
#include <stdio.h>
#include <math.h>
#include <algorithm>

using namespace std;

int n;
int tri[3];

void init() {
  scanf("%d", &n);
}

bool input() {

  if (!n--)
    return false; // 入力の終わり
  scanf("%d %d %d", &tri[0], &tri[1], &tri[2]);

  return true;
}

int main() {

  init();
  while (input()) {
    sort(tri, tri + 3);
    if (pow(tri[0], 2) + pow(tri[1], 2) == pow(tri[2], 2))
      printf("YES\n");
    else
      printf("NO\n");
  }

  return 0;
}

C++: #include<cstdio>
#include<algorithm>
int main(){
    int n,a[3];
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        for(int j=0;j<3;j++,scanf){
            scanf("%d",&a[j]);
        }
        std::sort(a,a+3);
        if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2]) printf("YES\n");
        else printf("NO\n");
    }
}