Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	num := int(n)
	var strs []string
	var a, b, c int
	var res string
	var YES string = "YES"
	var NO string = "NO"
	for i := 0; i < num; i++ {
		scanner.Scan()
		strs = strings.Split(scanner.Text(), " ")
		a, _ = strconv.Atoi(strs[0])
		b, _ = strconv.Atoi(strs[1])
		c, _ = strconv.Atoi(strs[2])

		res = NO
		if c*c == (a*a+b*b) || b*b == (a*a+c*c) || a*a == (b*b+c*c) {
			res = YES
		}
		fmt.Printf("%s\n", res)
	}
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a[3];
while(cin >>a[0]>>a[1]>>a[2]){
sort(a,a+3);
if((a[0] * a[0]) + (a[1] * a[1] ) == (a[2] * a[2])) cout << "yes" << endl;
else cout << "no"<<endl;
}
return 0;
}

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

using namespace std;

int main(void)
{
	int a[3];
	int n;
	
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		for (int j = 0; j < 3; j++){
			scanf("%d", &a[j]);
		}
		
		sort(a, a + 3);
		
		if (a[0] * a[0] == a[1] * a[1] + a[2] * a[2]){
			puts("YES");
		}
		else {
			puts("NO");
		}
	}
	
	return (0);
}

C++: /*
AOJ_0003_IsitaRightTriangle?

EOFはWindowsはCtrl+Z,UNIXはCtrl+D

方針
配列入れて昇順ソートして　１番目と２番目の二乗の合計が
三番目の二乗になってるか確かめる。

配列の大きさが３固定なので、multisetに格納するのはもったいない
普通の配列に入れて、sortを使う

*/

#include <iostream>
#include <string>
#include <cstdio>
#include <math.h>
#include <algorithm>

using namespace std;

int main() {
	int N, side[3], i,j;

	cin >> N;

	for (i = 0; i < 3; i++){
		cin >> side[0] >> side[1] >> side[2];
		sort(side, side + 3, greater<int>());

		if (pow(side[0], 2) + pow(side[1], 2) == pow(side[2], 2)){
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}	
	}
	return 0;
}

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

int main(){
  int N,i,a,b,c;

  scanf("%d",&N);
  for(i = 0;i<N;i++){
    cin >> a >> b >> c;
    a*=a;
    b*=b;
    c*=c;
    if(a+b==c||b+c==a||a+c==b)cout << "YES" << endl;
    else cout << "NO" << endl;

}
  return 0;
}

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

int N;
int a[3]; 
int b,c,d;

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

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

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

C++: #include<stdio.h>

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

C++: #include<stdio.h>
int main(void)
{
	int N=0;
    unsigned a[1001]={0},b[1001]={0},c[1001]={0};
	int soto=0;
	int i=0;
	scanf("%d",&N);
	for (i=0;i<N;i++)
	{
		scanf("%d %d %d",&a[i],&b[i],&c[i]);
		if (a[i]<b[i])
		{
			soto=a[i];
			a[i]=b[i];
			b[i]=soto;
		}
		if (a[i]<c[i])
		{
			soto=a[i];
			a[i]=c[i];
			c[i]=soto;
		}
	}
	for (i=0;i<N;i++)
	{
		if (a[i]*a[i]==b[i]*b[i]+c[i]*c[i])
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>

int main(){
	int n, a, b, c;
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%d%d%d", &a, &b, &c);
		if ((a > b || a == c)&& b > c){
			if (a * a == b * b + c * c)
				std::cout << "YES\n";
			else
				std::cout << "NO\n";
		}
		else if ((a < b || a == c) && b > c){
			if (a * a + c * c == b * b)
				std::cout << "YES\n";
			else
				std::cout << "NO\n";
		}
		else if ((a < b || a == b) && b < c){
			if (a * a + b * b == c * c)
				std::cout << "YES\n";
			else
				std::cout << "NO\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 clearset() {data.clear();}
};

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;
        tri.clearset();
    }

    return 0;
}

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

#define DEBUG

#ifndef DEBUG 
#define fprintf (void)
#endif 

int main(void){
	
	long int rec,i,j,t;
	int count=0;
	long int n[3]={0,0,0};
	
	scanf("%d",&t);
	
	for(i=0;i<t;i++){
		for(j=0;j<3;j++){
			scanf("%ld",&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;
			}
		}
		if(count=1){
			printf("NO\n");
		}else if(n[0]*n[0]==n[1]*n[1]+n[2]*n[2]){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int num;
	cin>>num;
	for(int i=0;i<num;i++){
		int a[3];
		cin>>a[0]>>a[1]>>a[2];
		sort(a,a+3);
		if(a[2]*a[2]==a[1]*a[1]+a[0]*a[0])
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
    return 0;
}

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

using namespace std;

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

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

using namespace std;

int main(){
  int a, b, c, a2, b2, c2;
  while(cin>>a>>b>>c){
    a2= a*a;
    b2= b*b;
    c2= c*c;

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

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

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

  cin >> n;

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

  return 0;
}

C++: #include <stdio.h>

int main()
{
    int n,a,b,c;
    scanf("%d",&n);
    while(n--)
    {
        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>
using namespace std;

int main()
{
    int a,b,c;
    while(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;
}

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

int main(){
	
	int n,a,b,c;
	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;
}