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 <cstdlib>
#include <vector>
#include <math.h>
using namespace std;

int main(){
	vector<vector<int> > a;

	int lines = 0;
	scanf("%d", &lines);

	bool isOk[lines];
	for (int i = 0; i < lines; ++i)
	{
		int l[3];
		for (int j = 0; j < 3; ++j)
			scanf("%d", &l[j]);

		if(pow(l[0], 2.0) + pow(l[1], 2.0) == pow(l[2], 2.0)) isOk[i] = true;
		if(!isOk[i] && pow(l[1], 2.0) + pow(l[2], 2.0) == pow(l[0], 2.0)) isOk[i] = true;
		if(!isOk[i] && pow(l[2], 2.0) + pow(l[0], 2.0) == pow(l[1], 2.0)) isOk[i] = true;
	}

	for (int i = 0; i < lines; ++i)
	{
		if(isOk[i]) printf("YES\n");
		else printf("NO\n");
	}
}

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

int pow(int i){return i*i;}

int main(){
    int num;
    cin >> num;
    int a[3];
    for(int i=0;i<num;i++){
        cin >> a[0] >> a[1] >> a[2];
        sort(a,a+3,greater<int>());
        if(pow(a[0])==pow(a[1])+pow(a[2]))cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define LL long long
#define ULL unsigned long long
#define rep(i, n) for (int i=0; i<(n); i++)
#define rep2(i, x, n) for (int i=x; i<(n); i++)
using namespace std;
int main(){
    
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    
    rep(i,n){
        
        int a, b, c;
        cin >> a >> b >> c;
        
        if(a>b&&a>c){
            cout << ( (a == b) == c ? "NO" : b*b + c*c == a*a ? "YES" : "NO" ) << endl;
        }else if(b>a&&b>c){
            cout << ( (a == b) == c ? "NO" : a*a + c*c == b*b ? "YES" : "NO" ) << endl;
        }else{
            cout << ( (a == b) == c ? "NO" : a*a + b*b == c*c ? "YES" : "NO" ) << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#define NMAX (1000)
using namespace std;
int main(void){
    
    int N = 0;
    int a=0;
    int b=0;
    int c=0;

    //N??°?????\???
    scanf("%d",&N);
    
    //N?????°???????????????a,b,c???????????????
    for(int Ncount = 0; Ncount < N; Ncount++){
        scanf("%d %d %d",&a,&b,&c);
        
        if( (a^2) + (b^2)  == (c^2) ){ printf("YES\n"); }
        else if( (b^2) + (c^2)  == (a^2)){ printf("YES\n"); } 
        else if( (c^2) + (b^2)  == (a^2)){ printf("YES\n"); }
        else{ printf("NO\n"); }
    }
}

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

// Is it a Right Triangle?(0003)
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		vector<int> dat(3);
		for (int j = 0; j < 3; ++j)
			cin >> dat[j];

		sort(dat.begin(), dat.end(), greater<int>());

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

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

bool isRightTriangle(int a, int b, int c) {
    return(a*a + b*b == c*c);
}

int main(void) {
    int num; cin >> num;
    vector<int> vec(num);
    for(int r = 0; r < num; r++) {
        cin >> vec[0] >> vec[1] >> vec[2];
        sort(vec.begin(), vec.end());
        cout << (isRightTriangle(vec[0], vec[1], vec[2]) ? "YES" : "NO") << endl;
    }
    return(0);
}

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

C++: #include <iostream>
int main(void){
	int n,a,b,c,d;
	std::cin>>n;
	while(n--){
		std::cin>>a>>b>>c;
		d=a>b?a:b;
		d=c>d?c:d;
		std::cout<<(a*a+b*b+c*c==2*d*d?"YES\n":"NO\n");
	}
}

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

int main(void){
	int x[3];
	int d,i = 0;
	cin >> d;
	string n = "NO", y = "YES";
	while(i < d){
		sort(x,x + 3);
		if(x[2] <= x[1] + x[0])
			cout << y << endl;
		else
			cout << n << endl;
		d++;
	}
	return 0;
}

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

  int a[num][3];


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


  for(int i=0; i<num; ++i){
    
    for(int j=0; j<3; ++j){
      for(int k=j+1; k<3; ++k){
	if(a[i][j] < a[i][k]){
	  tmp = a[i][j];
	  a[i][j] = a[i][k];
	  a[i][k] = tmp;
	}
      }
    }
    
    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 <stdio.h>

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int n;
    int a,b,c;

    cin >> n;

    for(int i=0; i<3; ++i){
        cin >> a >> b >> c;
        if(a < b){
            swap(a,b);
        }
        if(a < c){
            swap(a,c);
        }

        if((a*a) == (b*b + c*c)){
            cout << "YES" << endl;
        }
        else{
            cout << "NO" << endl;
        }
    }

    return 0;
}

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

bool checkRightTriangle(int side1, int side2, int side3) {
  std::vector<int> edges;
  edges.push_back(side1);
  edges.push_back(side2);
  edges.push_back(side3);
  std::sort(edges.begin(), edges.end(), std::greater<int>());
  if (pow(edges[0], 2) == pow(edges[1], 2) + pow(edges[2], 2)) {
    return true;
  } else {
    return false;
  }
}

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

  int a, b, c;
  std::vector<bool> results;

  for (size_t i = 0; i < data_num; i++) {
    std::cin >> a >> b >> c;
    results.push_back(checkRightTriangle(a, b, c));
  }

  for (bool result : results) {
    if (result) {
      std::cout << "YES" << '\n';
    } else {
      std::cout << "NO" << '\n';
    }
  }
  return 0;
}

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

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

	for(int i=0;i<n;++i){
		double a,b,c;
		cin >> a >> b >> c;
		double _a = pow(a,2),_b = pow(b,2),_c = pow(c,2);

		if(_a == _b + _c || _b == _a + _c || _c == _a + _b)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

bool CheckRightTriangle(int a,int b,int c);
int main(){
	int *a,*b,*c,datanum;
	cin>>datanum;
	a = new int[datanum];
	b = new int[datanum];
	c = new int[datanum];
	for( int i=0;i<datanum;i++ ){
		cin>>a[i]>>b[i]>>c[i];
	}
	for(int i=0;i<datanum;i++){
		if(CheckRightTriangle(a[i],b[i],c[i])){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	delete[] a;
	delete[] b;
	delete[] c;
	return 0;
}

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