Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())
	num := int(n)
	var strs []string
	var a, b, c int
	var res string
	var YES string = "YES"
	var NO string = "NO"
	for i := 0; i < num; i++ {
		scanner.Scan()
		strs = strings.Split(scanner.Text(), " ")
		a, _ = strconv.Atoi(strs[0])
		b, _ = strconv.Atoi(strs[1])
		c, _ = strconv.Atoi(strs[2])

		res = NO
		if c*c == (a*a+b*b) || b*b == (a*a+c*c) || a*a == (b*b+c*c) {
			res = YES
		}
		fmt.Printf("%s\n", res)
	}
}

C++: #include <string>
#include <iostream>
#include <vector>
#include <sstream>
using namespace std;
void swap(int idx1, int idx2, int *node)
{
	int f = node[idx1];
	node[idx1] = node[idx2];
	node[idx2] = f;
}
//nlogn
void quickSort(int left, int right, int *node)
{
	int pl = left;
	int pr = right;
	int pivot_f = node[(pl + pr) / 2];
	do
	{
		while (node[pl] < pivot_f)
		{
			pl++;
		}
		while (node[pr]> pivot_f)
		{
			pr--;
		}
		if (pl <= pr)
		{
			swap(pl++, pr--, node);
		}
	} while (pl <= pr);
	if (left < pr) quickSort(left, pr, node);
	if (pl <= right) quickSort(pl, right, node);
}

bool compare(int a, int b)
{
	if (a == b)
	{
		return true;
	}
	else {
		return false;
	}
}
int main()
{
	string max;
	getline(cin, max);
	for (int num = 0; num <= stoi(max); num++)
	{
		string str;
		string item;
		vector<string> list;
		getline(cin, str);
		int edge[3];
		stringstream ss(str);
		while (getline(ss, item, ' ') && !item.empty()) {
			list.push_back(item);
		}
		
		edge[0] = stoi(list[0].c_str());
		edge[1] = stoi(list[1].c_str());
		edge[2] = stoi(list[2].c_str());
		quickSort(0, 2, edge);

		int edge1 = edge[2] * edge[2];
		int edge2 = edge[0] * edge[0] + edge[1] * edge[1];
		if (compare(edge1, edge2))
		{
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<queue>
#define YES 1
#define NO 0
using namespace std;

int main(){
	int num, a, b, c, temp;
	queue<int> ans;
	
	cin >>num;
	
	for(int i = 0; i < num; i++){
		cin >>a >>b >>c;
		
		if(a > b){
			if(a > c);
			if(c > a) swap(a, c);
		} else{
			if(b > c) swap(a, b);
			if(c > b) swap(a, c);
		}
		
		if((a * a) == (b * b) + (c * c)) ans.push(YES);
		else ans.push(NO);
	}
	
	for(int i = 0; i < num; i++){
		temp = ans.front();
		if(temp == YES) cout <<"YES"<<endl;
		else cout <<"NO"<<endl;
		ans.pop();
	}
	
	return 0;
}

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

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
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 || b * b == c * c + a * a || c * c == a * a + b * b)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

C++: #include<iostream>

int main()
{
	int N, a, b, c;

	std::cin >> N;
	for (int i = 0; i < N; ++i)
	{
		std::cin >> a >> b >> c;
		a *= a;
		b *= b;
		c *= c;
		if (a == b + c || b == c + a || c == a + b)
			std::cout << "YES" << std::endl;
		else
			std::cout << "NO" << std::endl;
	}

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <bitset>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef long long LL;

int main() {
	int n;
	cin >> n;
	rep(i, n) {
		VI a(3);
		rep(j, 3)cin >> a[j];
		SORT(a);
		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2])puts("YES");
		else puts("NO");
	}
}

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

using namespace std;

int main() {

	int a, b, c,d,no;
	int result[1000];

	cin >> no;
	for (int i = 0; i < no; i++) {
		cin >> a >> b >> c;

		d = a;
		if (d < b)
			d = b;
		if (d < c)
			d = c;

		if (d == a) {
			if (a*a == b*b + c*c)
					result[i] = 1;
			else result[i]= 0;
			}
		else if (d == b) {
			if (b*b == a*a + c*c)
				result[i] = 1;
			else result[i] = 0;
		}
		else {
			if (c*c == a*a + b*b)
				result[i] = 1;
			else result[i] = 0;
		}
	}


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

	return 0;

}

C++: #include <iostream>

using namespace std;

int main(){
	int a; int b; int c; int i; int n; int st; int sa;
	cin >> n;
	for (i = 1; i <= n; i++){
		cin >> a >> b >> c;
		a = a*a;
		b = b*b;
		c = c*c;
		if (a < b){
			if (b < c){
				st = c;
			}
			else{
				st = b;
				b = c;
			}
		}
		else{
			if (a < c){
				st = c;
			}
			else{
				st = a;
				a = c;
			}
		}
		sa = st - a - b;
		if (sa == 0){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}

	getchar();
	getchar();
	return  0;
}

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

int l[3][3];

void swap(int a, int b, int c){
	int buf = l[c][a];
	l[c][a] = l[c][b];
	l[c][b] = buf;
}

//bubble
void sort(int c){
	for(int i = 0; i < 2; i++){
		for(int j = i; j < 2; j++){
			if(l[c][j] > l[c][j+1]) swap(j,j+1,c);	
		}
	}
}

int main(){
int buf;

cin >> buf;

for(int i = 0; i < buf; i++){	
	cin >> l[i][0] >> l[i][1] >> l[i][2];
	sort(i);
}

for(int j = 0; j < buf; j++){
	if(l[j][2]*l[j][2] == l[j][0]*l[j][0] +l[j][1]*l[j][1]){
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}
}

return 0;
}

C++: #include <iostream>

void checkTringle(int a,int b,int c){
    if(a * a == b * b + c * c){
        std::cout << "YES" << std::endl;
    }else{
        std::cout << "NO" << std::endl;
    }
}

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

    int side[3];

    for(int i=0; i<dataSize; i++){
        for(int a=0; a<3;a++){
            std::cin >> side[a];
        }

        for(int b = 0; b< 3; b++){
            for(int j=i+1; j<3;j++){
                if(side[i] > side[j]){
                    int tmp = side[i];
                    side[i] = side[j];
                    side[j] = tmp;
                }
            }
        }

        checkTringle(side[2],side[1],side[0]);
    }
}

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

int main()
{
  int cases; cin >> cases;
  while(cases--) {
    int a, b, c; 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 <iostream>


using namespace std;
 
int main()
{

	int a, b, c, d;
	cin >> a >> b >> c;

	d = c * c;

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