Go: package main

import "fmt"

func main() {
	var n int

	fmt.Scanf("%d", &n)

	var a, b, c int
	for i := 0; i < n; i++ {
		var isTriangle bool
		fmt.Scanf("%d %d %d", &a, &b, &c)

		if a*a == b*b+c*c || b*b == a*a+c*c || c*c == b*b+a*a {
			isTriangle = true
		}

		if isTriangle == true {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <iostream>

void checkTringle(int a,int b,int c){
    if(a * a == b * b + c * c){
        std::cout << "YES" << std::endl;
    }else{
        std::cout << "NO" << std::endl;
    }
}

int main(int argc, char *argv[])
{
    int dataSize;
    std::cin >> dataSize;

    int side[3];

    for(int i=0; i<dataSize; i++){
        for(int a=0; a<3;a++){
            std::cin >> side[a];
        }

        for(int b = 0; b< 3; b++){
            for(int j=i+1; j<3;j++){
                if(side[i] > side[j]){
                    int tmp = side[i];
                    side[i] = side[j];
                    side[j] = tmp;
                }
            }
        }

        for(int i=0; i<3; i++){
            std::cout << side[i] << std::endl;
        }
        checkTringle(side[2],side[1],side[0]);
    }
}

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

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


    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
 
using namespace std;
 
int main(){
  int num,tmp;
 
  cin >> num;

  int a[num][3];


  for(int i=0; i<num; ++i)
    cin >> a[i][0] >> a[i][1] >> a[i][2];


  for(int i=0; i<num; ++i){

    sort(a[i],a[i]+3,greater<int>());
    
    if(a[i][0]*a[i][0] == a[i][1]*a[i][1] + a[i][2]*a[i][2]){
      cout << "YES\n";
    }else{
      cout << "NO\n";
    }
  }  

}

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

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0003&lang=jp

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

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
void swap(int idx1, int idx2, int *node)
{
	int f = node[idx1];
	node[idx1] = node[idx2];
	node[idx2] = f;
}
//nlogn
void quickSort(int left, int right, int *node)
{
	int pl = left;
	int pr = right;
	int pivot_f = node[(pl + pr) / 2];
	do
	{
		while (node[pl] < pivot_f)
		{
			pl++;
		}
		while (node[pr]> pivot_f)
		{
			pr--;
		}
		if (pl <= pr)
		{
			swap(pl++, pr--, node);
		}
	} while (pl <= pr);
	if (left < pr) quickSort(left, pr, node);
	if (pl <= right) quickSort(pl, right, node);
}

bool compare(int a, int b)
{
	if (a == b)
	{
		return true;
	}
	else {
		return false;
	}
}
int main()
{
	int max = 0;
	cin >> max;
	for (int num = 0; num < max; num++)
	{
		string str;
		string item;
		vector<string> list;
		getline(cin, str);
		int edge[3];
		stringstream ss(str);
		while (getline(ss, item, ' ') && !item.empty()) {
			list.push_back(item);
		}
		for (int i = 0; i < 3; i++)
		{
			edge[i] = stoi(list[i].c_str());
		}
		quickSort(0, 2, edge);

		int edge1 = edge[2] * edge[2];
		int edge2 = edge[0] * edge[0] + edge[1] * edge[1];
		if (compare(edge1, edge2))
		{
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

int main(){
	int d;
	cin>>d;
	while(d>0){
		int num[3];
		for(int i = 0 ; i < 3 ; i++ )
		{
			cin>>num[i];
		}
		for(int i = 0 ; i < 3 ; i++)
		{
			for(int j = i+1; j < 3 ; j++)
			{
				if( num[i] > num[j] )
				{
					int q = num[i];
					num[i] = num[j];
					num[j] = q;
				}
			}
		}
		if( num[2]*num[2] - num[1]*num[1] == num[0]*num[0] )
		{
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
		d--;
	}
}

C++: #include <bits/stdc++.h>
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*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a) cout << "YES" << endl;
        else cout << "NO" << endl;
  }
}

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

int main(){

int i,j,d,n1,n2,n3,k,temp;


   cin >> d;
   while(d <= 1 or d >= 1000){
       cin >> d;
   }
 

 
 int l[d][3];
 

//入力
for(i=0; i<d; i++){
   cin >> n1 >> n2 >> n3;
   
   if(n1 >= 1 and n1 <= 1000 and n2 >= 1 and n2 <=1000 and n3 >= 1 and n3 <= 1000){
       l[i][0]=n1;
       l[i][1]=n2;
       l[i][2]=n3;
        for (k = 0; k < 2; k++) {
        for (j = 2; j > k; j--) {
            if (l[j - 1] > l[j]) {  
                temp = l[i][j];  
                l[i][j] = l[i][j - 1];
                l[i][j - 1] = temp;
            }
        }
    }
   }else{
   i--;
   }
}

    
//出力
for (i = 0; i < d; i++) {
    if(l[i][2]*l[i][2] == (l[i][1]*l[i][1]+l[i][0]*l[i][0])){
    cout << "YES\n";
    }else{
    cout << "NO\n";
    }
}

    return 0;
}

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

int right_triangle(int a,int b,int c)
{
	if (   a == sqrt(pow(b,2)+pow(c,2)) 
	    || b == sqrt(pow(c,2)+pow(a,2))
	    || c == sqrt(pow(a,2)+pow(b,2)))
	    return 1;
	else
		return 0;
}

int main()
{
	int a[3],n;
	cin >> n;
	for(int j=0;j<=n-1;j++){
		for(int i=0;i<=2;i++)
			cin >> a[i];
		switch (right_triangle(a[0],a[1],a[2]))
		{
		case 0:
			cout << "NO" << endl;
			break;
		case 1:
			cout << "YES" << endl;
			break;
		default:
			cout << "error" << endl;
			break;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int set,i,j;
	cin>>set;
	int dats[set][3];
	for(i=0; i<set; i++)
	{   
	   for(j=0; j<3; j++)
	   {
	   	   cin>>dats[i][j];	   	   
           dats[i][j]=dats[i][j];
	   }
    }
	for(i=0; i<set; i++)
	{   
		if((sqrt((pow(dats[i][0],2))+(pow(dats[i][1],2))))==(dats[i][2]))
		cout<<"YES"<<endl;	   
		else
		cout<<"NO"<<endl;
    }
    return 0;
}

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

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

C++: #include<iostream>
using namespace std;
int main()
{
	int times;
	cin >> times;
	bool * a = new bool[times];
	for (int i = 0; i<times; ++i)
	{
		int q, w, e;
		cin >> q >> w >> e;
		if (q + w>e&&q + e>w&&e + w>q)
		{
			a[i] = true;
		}
		else
		{
			a[i] = false;
		}
	}
	if (a[0])    cout << "true";
	else    cout << "false";
	for (int i = 1; i<times; ++i)
	{
		if (a[i])    cout << endl << "TRUE";
		else    cout << endl << "FALSE";
	}
}