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>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int lld;

const lld mod = 1e9+7;
const lld INF = 1e9;
//const lld MAXN = 1e9;

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

	cin >> n;
	for(int i = 0; i < n; i++)
	{
		cin >> a >> b >> c;

		int x,y,z;

		x = max(max(a,b),max(b,c));
		z = min(min(a,b),min(b,c));
		y = a+b+c-x-z;

		if (x*x == y*y + z*z)
		{
			cout << "YES" << endl;
		}else
		{
			cout << "NO" << endl;
		}
	}


	return 0;
}

C++: #include<stdio.h>

int main(void)
{
	int i;
	int x[1000]={0},y[1000]={0},z[1000]={0},hantei[1000];
	int j=0,e=0;

	while(e==0)
	{
		scanf("%d %d %d",&x[j],&y[j],&z[j]);
		
		if(x[j]<1 || 1000<x[j] || y[j]<1 || 1000<y[j] || z[j]<1 || 1000<z[j])break;

		j=j+1;
	}

	for(i=0;i<j;i++)
	{
		if(y[i]<x[i] && z[i]<x[i])
		{
			if(x[i]*x[i] == y[i]*y[i]+z[i]*z[i])
				hantei[i]=1;
			else
				hantei[i]=0;
		}
		else if(x[i]<y[i] && z[i]<y[i])
		{
			if(y[i]*y[i] == x[i]*x[i]+z[i]*z[i])
				hantei[i]=1;
			else
				hantei[i]=0;
		}
		else
		{
			if(z[i]*z[i] == x[i]*x[i]+y[i]*y[i])
				hantei[i]=1;
			else
				hantei[i]=0;
		}
	}
	for(i=0;i<j;i++)
	  {   
	   switch(hantei[i])
	    {
		   case 0:
			  printf("NO\n");
			  break;
		   case 1:
			  printf("YES\n");
		      break;
		   default:
			   break;
	   }
	}

	return 0;
}

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

int main() {
  int ct = 0;
  vector<int> v(3);

  scanf("%d", &ct);
  for(int i = 0; i < ct; i++) {
    scanf("%d %d %d", &v[0], &v[1], &v[2]);
    sort(v.begin(), v.end());                    
    if(v[2] * v[2] == v[0] * v[0] + v[1] * v[1]) printf("YES\n");
    else printf("NO\n");
    v.clear();
  }
  return 0;
}

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

C++: #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
    int n,a[3],b[3],l,k;
    cin>>n;
    for(l=0;l<n;l++){
        if(l>1000){
            break;
        }
        for(k=0;k<3;k++){
            cin>>a[k];
            if(a[k]>1000||a[k]<=0){
                break;
            }
            b[k]=a[k]^2;
        }
        sort(b,b+3);
        if(b[2]==b[0]+b[1]){
            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 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 <algorithm>

using namespace std;

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

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

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

}

C++: #include <cstdio>
int main()
{

        int i;
        scanf("%d",&i);

        int tri[8][3];

        int cnt,k;

        for(cnt=0;cnt<i;cnt++)
        {
                scanf("%d %d %d",&tri[cnt][0],&tri[cnt][1],&tri[cnt][2]);        
                for(k=0;k<3;k++)
                {
                        tri[cnt][k]=tri[cnt][k]*tri[cnt][k];
                }
                if(tri[cnt][0]==(tri[cnt][1]+tri[cnt][2])||tri[cnt][1]==(tri[cnt][2]+tri[cnt][0])||tri[cnt][2]==(tri[cnt][0]+tri[cnt][1])) printf("YES\n");
                else printf("NO\n");
        }

        return 0;
}

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

int main() {
	int N;
	cin >> N;

	for (int i = 0; i < N; i++) {
		vector<int> v(3);
		cin >> v.at(0) >> v.at(1) >> v.at(2);

		sort(v.begin(), v.end());
		int& a = v.at(0),
			& b = v.at(1),
			& c = v.at(2);
		a *= a;
		b *= b;
		c *= c;
		if (a + b == c) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
	int n;
	cin>>n;
	while(n--){
		vector<int> v(3);
		for (int i = 0; i < 3; ++i){
			cin>>v[i];
		}
		sort(v.begin(), v.end());
		if (v[2]*v[2] == v[0]*v[0] + v[1]*v[1])
			cout<<"YES";
		else
			cout<<"NO";
		cout<<endl;
	}
	return 0;
}

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

int a, b, c, n;

int main()
{
    cin >> n;

    for (int i = 0; i < n; ++i) {
        cin >> a >> b >> c;

        if (a > c) swap(a, c);
        if (b > c) swap(b, c);

        cout << (a * a + b * b == c * c ? "YES" : "NO") << endl;
    }

    return 0;
}

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

int main()
{
  int n;
  cin >> n;
  for (int dataset=0; dataset<n; dataset++)
  {
    int triangle[3];
    cin >> triangle[0] >> triangle[1] >> triangle[2];
    for (int i=0; i<3; i++)   //sort
    {
      int tmp;
      for (int j=i; j != 0 && triangle[j] > triangle[j-1]; j--)
      {
        tmp = triangle[j];
        triangle[j] = triangle[j-1];
        triangle[j-1] = tmp;
      }
    }

    if ( triangle[0]*triangle[0] == triangle[1]*triangle[1] + triangle[2]*triangle[2] )
    {
      cout << "YES" << endl;
    }
    else
    {
      cout << "NO" << endl;
    }
  }  
}

C++: #include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>

#define doubled( x ) (x * x)

//?????°?????°?????? (in:??´??° out:?????°)
int digit_count(int num);

using namespace std;

int main()
{
	int N; cin >> N;
	vector<int> data(3);
	
	for(int i = 0; i < N; i++)
	{
		for(int j = 0; j < 3; j++)
		{
			cin >> data[j];
		}
		sort(data.begin(), data.end());
		
		if( ( doubled(data[0]) + doubled(data[1]) ) == doubled(data[2]) )cout << "YES";
		else cout << "NO";
		
		cout << endl;
	}
	return 0;
}

int digit_count(int num)
{
	if( num < 0 )num *= (-1);
	
	int count = 0;
	
	for(int i = 10; num != 0; i *= 10)
	{
		int diff = num % i;
		num -= diff;
		count++;
	}
		
	return count;
}

C++: #include <iostream>
#include <cmath>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;

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

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

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