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<stdio.h>

int getLongestIndex(int length[3]);

 int main(void){
   int num;
   int length[3];

   fscanf(stdin,"%d",&num);
   for(int i = 0;i < num;i++){
     fscanf(stdin,"%d %d %d",&length[0],&length[1],&length[2]);
     if(length[0] != length[1] && length[1] != length[2] && length[0] != length[2]){
       int longest = length[getLongestIndex(length)];
       longest *= longest;

       int other = 0;
       for(int n = 0;n < 3;n++){
         if(n == getLongestIndex(length)){
           continue;
         }
         other += length[n] * length[n];
       }

       if(longest == other){
         printf("YES\n");
       }
       else{
         printf("NO\n");
       }
     }
     else{
       printf("NO\n");
     }
   }

   return 0;
 }

 int getLongestIndex(int length[3]){
   int longerIndex = -1;
   int longer = -1;
   for(int i = 0;i < 3;i++){
     if(longer < length[i]){
       longer = length[i];
       longerIndex = i;
     }
   }
   return longerIndex;
 }

C++: #include <iostream>
//#include <cstdio>
//#include <cmath>
using namespace std;
 
//0003
int main(){
	int n;
	int a, b, c, a2, b2, c2;
	cin >> n;
	while(n--){
		cin >> a >> b >> c;
		a2 = a*a;
		b2 = b*b;
		c2 = c*c;

		if(a==b && b==c){
			cout << "NO" << endl;
			break;
		}
		if(a2==b2+c2 || b2==a2+c2 || c2==a2+b2){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
bool bigger (int a, int b) { return (a > b); }
void isRTriangleAndPrint (int a, int b, int c) {
	std::vector<int> list(3, 0);
	list[0]=a;list[1]=b;list[2]=c;
	sort(list.begin(), list.end(), bigger);
	if (list[0]*list[0] == list[1]*list[1]+list[2]*list[2])
		puts("YES");
	else
		puts("NO");
}

int main (int argc, char *argv[]) {
	int dataNumber;
	fscanf(stdin, "%d\n", &dataNumber);
	
	int side[3];
	for(int i = 0; i < dataNumber; ++i) {
		fscanf(stdin, "%d %d %d\n", &side[0], &side[1], &side[2]);
		isRTriangleAndPrint(side[0], side[1], side[2]);
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int N;
	cin >> N;
	while(N--){
		int i[3],c;
		int max;
		cin >> i[0] >> i[1] >> i[2];
		sort(i,i+2);
		if(i[0]*i[0]+i[1]*i[1]==i[2]*i[2])
			cout<<"YES\n";
		else
			cout<<"NO\n";

	}
}

C++: #include<iostream>
#include<sstream>
#include<cstdio>
#include<fstream>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
using namespace std;
bool power(int c,int a,int b){
	return pow(c,2)==(pow(a,2)+pow(b,2));
}
int main(){
	int n;
	scanf("%d",&n);
	stringstream buf;
	for(int x=0;x<n;++x){
		int i,j,k;
		scanf("%d %d %d",&i,&j,&k);
		if(power(i,j,k) || power(j,i,k) || power(k,i,j)){
			buf<<"YES\n";
		}else{
			buf<<"NO\n";
		}
	}
	cout<<buf.str()<<endl;
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;

bool check(int x,int y,int z){
	if(x*x == y*y+z*z) return 1;
	else return 0;
}

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 && check(a,b,c)) printf("YES\n");
		else if(b>=c && b>=a && check(b,c,a)) printf("YES\n");
		else if(c>=a && c>=b && check(c,a,b)) printf("YES\n");
		else printf("NO\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;

        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<stdio.h>
#include<algorithm>

using namespace std;

int main(){
	int n,a,b,c;
	int m=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int a[3];
		for(int j=0;j<3;j++)scanf("%d",&a[j]);
		std::sort(a,a+3);
		
		int d = 32;
		if(a[0]>d || a[1]>d || a[2]>d)puts("hogehogehoge");
		
		if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]){
			puts("YES");
		}else{
			puts("NO");
		}
	}
}

C++: #include <iostream>

using namespace std;

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

    return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int main(){
    int a,b,c,n;
    while(~scanf("%d",&n)){
    while(n--)
    {
        cin>>a>>b>>c;
        if(a+b>c&&a+c>b&&b+c>a&&(a*a+b*b==c*c||a*a==b*b+c*c||a*a+c*c==b*b))
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    }
    return 0;
}

C++: #include<cstdio>
#include<algorithm>
using namespace std;
int main(int argc, char const *argv[])
{
    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);
        double a= (double)A[0], b= (double)A[1], c= (double)A[2];
        double cosine = (b*b+a*a-c*c)/(2*b*c);

        if(cosine == 0) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}

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

C++: #include <iostream>
#include <cmath>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
  for (int i = 0; i < n; ++i) {
    int x, y, z;
    cin >> x >> y >> z;
    int m = max(x, max(y, z));
    if (m == x) {
       if (x > y + z) cout << "YES";
       else cout << "NO";
    } else if (m == y) {
       if (y > x + z) cout << "YES";
       else cout << "NO";
    } else if (m == z) {
       if (z > x + y) cout << "YES";
       else cout << "NO";
    }
    cout << endl;
  }
  }
  return 0;
}

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

int main(){
	int N;
	int l1, l2, l3;
	int answer=0;
	vector<int> lines;
	cin >> N;
	for(int i=0;i<N;i++){
		cin >> l1 >> l2 >> l3;
		lines.push_back(l1);
		lines.push_back(l2);
		lines.push_back(l3);
		while(next_permutation(lines.begin(), lines.end())){
			if(pow(lines[0],2) == pow(lines[1],2) + pow(lines[2],2)) answer = 1;
		}
		if (answer == 1) cout << "YES\n";
		else cout << "NO\n";
		lines.clear();
		answer = 0;
	}
	return 0;
}