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 <vector>

using namespace std;

int main(int argc, char** argv)
{
    int num;

    cin >> num;
    for (int i = 0; i < num; i++) {
        vector<int> v = vector<int>(3);
        cin >> v[0] >> v[1] >> v[2];
        sort(v.begin(), v.end());
        if (v[0] * v[0] + v[1] * v[1] == v[2] * v[2]) {
            cout << "YES\n";
        } else {
            cout << "NO\n";
        }
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

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

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

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

	int a[n], b[n], c[n];

	for(int i=0; i<n; i++){
		if(a[i]*a[i] == b[i]*b[i] + c[i]*c[i]){
			cout << "YES" << endl;
			continue;
		}
		if(b[i]*b[i] == a[i]*a[i] + c[i]*c[i]){
			cout << "YES" << endl;
			continue;
		}
		if(c[i]*c[i] == b[i]*b[i] + a[i]*a[i]){
			cout << "YES" << endl;
			continue;
		}
		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]={0};
	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 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
		{
			if(z[i]*z[i] == x[i]*x[i]+y[i]*y[i])
				hantei[i]=1;
		}
	   
	switch(hantei[i])
	    {
		   case 0:
			  printf("No\n");
			  break;
		   case 1:
			  printf("Yes\n");
		      break;
	   }
	}

	return 0;
}

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

int main()
{ 
	int a, b, c, n;
	cin >> n;
	for (int i = 1; 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 <cstdio>
#include <cmath>

bool triangle(int x, int y, int z) {
	return pow((double)x, 2) + pow((double)y, 2) == pow((double)z, 2);
}

int main(void) {
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		int x, y, z;
		scanf("%d %d %d", &x, &y, &z);
		if(triangle(x, y, z) || triangle(y, x, z) || triangle(z, x, y))
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}

C++: #include<iostream>

bool right_triangle(int a,int b,int c)
{
    if (a*a + b*b == c*c || b*b + c*c == a*a || c*c + a*a == b*b) {
        return true;
    }else{
        return false;
    }   
}

int main()
{
    int x,y,z,N;
    std::cin >> N;
    for (int i = 0; i < N; i++) {
        std::cin >> x >> y >> z;
        if (right_triangle(x,y,z)) {
            std::cout << "Yes" << std::endl;
        }else if (right_triangle(x,y,z) == 0 ) { 
            std::cout << "No" << std::endl;
        }
    }   
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n,a,b,c,x;
	int arry[1024];
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a >> b >> c;

		if(a > c){
			x = c;
			c = a;
			a = x;
		}
		if(b > c){
			x = c;
			c = b;
			b = x;
		}

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

	return 0;
}

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

int main()
{
	int iN, Temp;
	int iNum[3], iTrueFlag[1000];

	cin >> iN;

	for( int i=0; i<iN; i++ ){
		cin >> iNum[0] >> iNum[1] >> iNum[2];

		for( int j = 0; j < 3; j++ ){
			for( int k = j + 1; k < 3; k++ ){
				if( iNum[j] > iNum[k] ){
					Temp    = iNum[j];
					iNum[j] = iNum[k];
					iNum[k] = Temp;
				}
			}
		}

		if( (iNum[0] * iNum[0]) + (iNum[1] * iNum[1]) == (iNum[2] * iNum[2]) ) iTrueFlag[i] = 1;
		else																   iTrueFlag[i] = 0;

	}

	for( int i=0;i<iN;i++ ){
		if( iTrueFlag[i] == 1 ) cout << "YES" << endl;
		else				    cout << "NO" << endl;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  long long n,a,b,c;
  cin >> n;
  long long tmp[3];
  for(int i=0;i<n;i++){
    cin >> a >> b >> c;
    tmp[0]=a;tmp[1]=b;tmp[2]=c;
    sort(tmp,tmp+3);
    if(tmp[0]*tmp[0]+tmp[1]*tmp[1]==tmp[2]*tmp[2]){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
  return 0;
}

C++: #include <cstdio>
#include <algorithm>

using namespace std;

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

C++: #include <iostream>

bool is_right_triangle(u_int a, u_int b, u_int c) {
    return ((a*a == b*b + c*c) || (b*b == c*c + a*a) || (c*c == a*a + b*b));
}

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

    std::cin >> n;
    while (std::cin >> a >> b >> c) {
        if (is_right_triangle(a, b, c)) {
            std::cout << "Yes" << std::endl;
        } else {
            std::cout << "No" << std::endl;
        }
    }

    return 0;
}

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

int main()
{
	priority_queue<int> que;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		int a, b, c;
		for (int j = 0; j < 3; j++)
		{
			cin >> a;
			que.push(a);
		}
		a = que.top();
		que.pop();
		b = que.top();
		que.pop();
		c = que.top();
		que.pop();
		if (a*a==b*b+c*c)
			cout << "YES"<<endl;
		else
			cout << "NO"<<endl;
	}
	return 0;
}

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

int main(){
    float a[1000], b[1000], c[1000];
    int n, i;

    cin>>n;
    if(n< 1000){
    for(i=0; i<n; i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(i=0; i<n; i++){
        if((b[i] + c[i]) / 2 == a[i] and a[i] != c[i]){
            cout<<endl<<"YES";}
        else{
            cout<<endl<<"NO";
        }
    }}
    return 0;
}

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

C++: #include<stdio.h>
int main(){
  int n;
  int a[3];
  int temp;
  int i,j,k;
  scanf("%d",&n);
  for(k=0;k<n;k++){
    for(i=0;i<3;i++){
      scanf("%d",&a[i]);
    }
    for(i=0;i<2;i++){
      for(j=0;j<2-i;j++){
	if(a[j]<a[j+1]){
	  temp=a[j];
	  a[j]=a[j+1];
	  a[j+1]=temp;
	}
      }
    }
    if(a[0]*a[0]==a[1]*a[1]+a[2]*a[2]){
      printf("YES\n");
    }else{
      printf("NO\n");
    }
  }
  return 0;
}