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 <bits/stdc++.h>
// #include "bits/stdc++.h"

#define pout(n)  printf ("%d\n", n)

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)

const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };
 
typedef long long ll;
using namespace std;
 
int main() {
  int n;
  cin >> n;
  int a[n],b[n],c[n];
  
  rep(i,0,n){
    cin >> a[i] >> b[i] >> c[i];
  }

  rep(i,0,n){
    if(a[i] < b[i]){
      swap(a[i],b[i]);
    }
    if(a[i] < c[i]){
      swap(a[i],c[i]);
    }
    if(pow(a[i],2) == pow(b[i],2)+pow(c[i],2)){
      puts("YES");
    }
    else{
      puts("NO");
    }
  }
  return 0;
}

C++: #include <stdio.h>

void judge_right_triangle(int a, int b, int c);

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

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
    vector<int> a(3);
    int N;
    cin >> N;
    while (N--) {
        for (int i = 0; i < 3; i++) {
            cin >> a[i];
        }
        sort(a.begin(), a.end());
        cout << (a[0]*a[0] + a[1]*a[1] == a[2]*a[2] ? "YES" : "NO") << endl;
    }
    return 0;
}

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

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

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

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

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

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

C++: #include <stdio.h>

void right_triangle(int a, int b, int c)
{
    if ((a * a + b * b == c * c) || (a * a + c * c == b * b) || (b * b + c * c == a * a)) {
        printf("YES\n");
    }
    else {
        printf("NO\n");
    }
}

int main(void)
{
    int n, a, b, c;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        scanf("%d %d %d", &a, &b, &c);
        right_triangle(a, b, c);
    }    
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <functional>
#include <numeric>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <set>

using namespace std;

#define ALL(co) co.begin(), co.end()

typedef long long LL;
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> Array;
typedef vector<int> LArray;

const int INF = 1 << 29;
const LL LINF = 1LL << 60;

int itiv;
inline int getInt() { return (cin >> itiv, itiv); }
void readAll(Array& vec, int n) { for (int i = 0; i < n; i++) cin >> vec[i]; }
inline bool between(int first, int last, int n) { return first <= n && n <= last; }
inline bool inRange(int begin, int end, int n) { return begin <= n && n < end; }
inline bool inRange(int size, int n) { return 0 <= n && n < size; }

int m, n;
int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, -1, 0, 1 };
int dr[] = { 0, -1, 0, 1 }, dc[] = { -1, 0, 1, 0 };


int main(void)
{
	while(cin >> n && n)
	{
		for (int i = 0; i < n; i++)
		{
			vector<int> arr(3);
			for (int i = 0; i < 3; i++)
			{
				cin >> arr[i];
			}
			sort(ALL(arr));
			cout << (arr[2] * arr[2] == arr[0] * arr[0] + arr[1] * arr[1] ? "YES" : "NO") << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    int a;
    cin >> a;
    for (int i=0;i<a;i++){
        int x,y,z;
        cin >> x >> y >> z;
        if (x^2+y^2!=z^2 && x^2+z^2!=y^2 && y^2+z^2!=x^2)
            cout << "NO" << endl;
        else
            cout << "YES" << endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <sstream>

using namespace std;


vector<string> splitString(const string& str, const string& separator = " ") {
	vector<string> ret;

	std::size_t bp, ep;
	bp = ep = 0;
	while((ep = str.find_first_of(separator, bp)) != string::npos){
		if(bp != ep){
			ret.push_back(string(str.begin() + bp, str.begin() + ep));
		}
		bp = ep + 1;
	}

	if(bp <= str.size() - 1){
		ret.push_back(string(str.begin() + bp, str.end()));
	}

	return ret;
}

template <class T>
T convertStringToNumber(const string& str) {
	stringstream ss;
	T ret;

	ss << str;
	ss >> ret;

	return ret;
}


void inputData(vector<string>& data_set) {
	string buffer;

	getline(cin, buffer);
	int n = convertStringToNumber<int>(buffer);

	for(int i = 0; i < n; ++i) {
		getline(cin, buffer);
		data_set.push_back(buffer);
	}
}

bool isRightTriangle(const vector<int>& edge_set) {
	int max_index = 0;

	if(edge_set[max_index] < edge_set[(max_index+1)%3])
		max_index = (max_index+1)%3; 
	if(edge_set[max_index] < edge_set[(max_index+2)%3])
		max_index = (max_index+2)%3; 

	return ((edge_set[max_index] * edge_set[max_index]) ==
				(edge_set[(max_index+1)%3] * edge_set[(max_index+1)%3]
				+ edge_set[(max_index+2)%3] * edge_set[(max_index+2)%3]));
}


vector<bool> evaluateTriangle(const vector<string>& data_str) {
	vector<bool> ret(data_str.size());

	for(int i = 0; i < data_str.size(); ++i) {
		auto temp = splitString(data_str[i]);
		vector<int> buff { convertStringToNumber<int>(temp[0]),
							convertStringToNumber<int>(temp[1]),
							convertStringToNumber<int>(temp[2])};

		ret[i] = isRightTriangle(buff);
	}

	return ret;
}


void doAllProcess() {
	vector<string> buffer;

	inputData(buffer);

	vector<bool> ret = evaluateTriangle(buffer);

	for(int i = 0; i < ret.size(); ++i)
		std::cout << (ret[i] ? "YES" : "NO") << std::endl;
}



int main() {
	doAllProcess();

	return 0;
}

C++: #include<cstdio>
#include<algorithm>
int main(void)
{
	int a,s,d,f,g,h,i,j;
	scanf("%d",&f);
	for(i=0;i<f;i++){
		scanf("%d %d %d",&a,&s,&d);
		if(a*a==s*s+d*d||d*d==s*s+a*a||s*s==d*d+a*a)
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}