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>
   
inline bool isRightTriangle(const u_int a, const u_int b, const u_int c){
    return (a*a == b*b + c*c || b*b == c*c + a*a || c*c == a*a + b*b);
}
   
int main(){
    u_int n;
    std::cin >> n;
      
    for (u_int i = 0; i < n; ++i){
        u_int a, b, c;
        std::cin >> a >> b >> c;
        std::cout << (isRightTriangle(a, b, c) ? "YES" : "NO") << std::endl;
    }
   
    return 0;
}

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

#define rep(p,q) for(int i = p; i < q;i++)

//3
int main(void) {
	int num;
	cin >> num;
	rep(0, num) {
		vector<int> line = vector<int>();
		rep(0, 3){
			int a;
			cin >> a;
			line.push_back(a);
		}
		sort(line.begin(),line.end());
		if (pow(line[0],2.0)  + pow(line[1],2.0) == pow(line[2],2.0)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

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

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

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

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <complex>
#include <cmath>
#include <algorithm>
#include <map>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
int main(){
	int num,x,y,z;
	vector<int> tmp1,tmp2,tmp3;
	cin>>num;
	for(int i=0;i<num;i++){
		cin>>x>>y>>z;
		tmp1.push_back(x);
		tmp2.push_back(y);
		tmp3.push_back(z);
	}
	for(int i=0;i<num;i++){
		tmp1[i]*=tmp1[i];
		tmp2[i]*=tmp2[i];
		tmp3[i]*=tmp3[i];
		int high=max(tmp1[i],max(tmp2[i],tmp3[i]));
		int sum=tmp1[i]+tmp2[i]+tmp3[i];
		if(high==sum/2) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
}

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

int main(){
	int n,s=1;
	cin >> n;
	
	while( n>=s ){
		int i=0,k=0,j=0,l=0;
		cin >> i >> k >> j;

		if( i<k ){
			l = i;
			i = k;
			k = l;
		}
		if( i<j ){
			l = i;
			i = j;
			j = l;
		}

		i = i*i;
		j = j*j;
		k = k*k;

		if( i==(j+k) ) cout << "YES" << "\n";
		else cout << "NO" << "\n";
		s++;
	}
}

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

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

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

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

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

C++: #include<iostream>

unsigned short a, b, c;
bool flag;

int main()
{
	while(std::cin>>a>>b>>c)
	{
		if (a==0||b==0||c==0)
		{
			continue;
		}

		flag = false;
		if((a*a)+(b*b)==(c*c))
		{
			flag = true;
		}
		else if((a*a)+(c*c)==(b*b))
		{
			flag = true;
		}
		else if((b*b)+(c*c)==(a*a))
		{
			flag = true;
		}
		if(flag==false)
		{
			printf("NO\n");
		}
		else
		{
			printf("YES\n");
		}
	}
	return 0;
}

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

C++: #include<iostream>

int main(){
	int a,b,c,i,n;
	std::cin>>n;
	for(i=0;i<n;i++){
	std::cin>>a>>b>>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==b*b+a*a){
		std::cout<<"YES"<<std::endl;
			}else{
			std::cout<<"NO"<<std::endl;
			}
		}
	

    return 0;
}

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

using namespace std;


int main()
{
    int num;
    int tmp;
    vector<int> store_num;
    
    cin >> num;
    for (int i = 0; i < num; i++)
    {
        store_num.clear();
        for (int j = 0; j < 3; j++)
        {
            cin >> tmp;
            store_num.push_back(tmp);
        }
        
        sort(store_num.begin(), store_num.begin() + 3);
        if ((store_num[0] * store_num[0]) + (store_num[1] * store_num[1]) == (store_num[2] * store_num[2]))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }
    
    return 0;
}

C++: #include <iostream>

bool judge(int x, int y, int z);

int main()
{
    int data_num;
    std::cin >> data_num;

    int side1, side2, side3;
    while (data_num--) {
        std::cin >> side1 >> side2 >> side3;
        std::cout << (judge(side1, side2, side3)? "YES": "NO") << std::endl;
    }

    return 0;
}

int pow2(int x);

bool judge(int x, int y, int z)
{
    if (pow2(x) == pow2(y) + pow2(z)) {
        return true;
    } else if (pow2(y) == pow2(z) + pow2(x)) {
        return true;
    } else if (pow2(z) == pow2(x) + pow2(y)) {
        return true;
    } else {
        return false;
    }
}

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

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

int compare_int(const void *a, const void *b)
{
  return *(int*)a - *(int*)b; 
}

int main()
{
  int n;
  int xs[3];

  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d %d", &xs[0], &xs[1], &xs[2]);
    qsort(xs, 3, sizeof(int), compare_int);
    if (pow(xs[0], 2.0) + pow(xs[1], 2.0) == pow(xs[2], 2.0)) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }

  return 0;
}

C++: #include <stdio.h>

void right_triangle (int x, int y, int z)
{
    if(x * x = y * y + z * z || y * y = z * z + x * x || z * z = x * x + y * y){
        printf("YES\n");
    } else {
        printf("NO\n");
    }
}

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);
        right_triangle(x, y, z);
    }
    return 0;
}