Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	li := make([]int, 3)

	sc.Scan()
	N, _ := strconv.Atoi(sc.Text())

	for i := 0; i < N; i++ {
		for j := 0; j < 3; j++ {
			sc.Scan()
			x, _ := strconv.Atoi(sc.Text())
			li[j] = x
		}
		sort.Ints(li)

		switch li[2]*li[2] == li[1]*li[1]+li[0]*li[0] {
		case true:
			fmt.Println("YES")
		case false:
			fmt.Println("NO")
		default:
		}
	}

}

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

void swap(int *a, int *b)
{
	int temp = *a;
	*a = *b;
	*b = temp;
}

int main()
{
	const int BUFF_SIZE = 100;
	char buff[BUFF_SIZE];
	
	fgets(buff, BUFF_SIZE, stdin);
	int count = atoi(buff);
	
	for (int i = 0; i < count; i++)
	{
		fgets(buff, BUFF_SIZE, stdin);
		int a, b, c;
		sscanf(buff, "%d %d %d", &a, &b, &c);
		
		if (c > b)
		{
			swap(&b, &c);
		}
		if (b > a)
		{
			swap(&a, &b);
		}
		
		int flag = ((a * a) == (b * b + c * c));
		
		printf("%s\n", flag ? "YES" : "NO");
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <fstream>
#include <stdint.h>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
using namespace std;

constexpr int INF       = 1000000000;/* 1e+9a */
constexpr int MODULO    = 1000000007;

#define REP(i,f,n) for(int i=(f); i < (n); ++i)
#define PER(i,f,n) for(int i=(n-1); i >= f; --i)

constexpr int evx[4] = { 1, 0, -1, 0 };
constexpr int evy[4] = { 0, 1, 0, -1 };

//----------------------------------
//----------------------------------

signed main()
{
    ios::sync_with_stdio(false);
	int n;
	cin >> n;
	REP(i, 0, n)
	{
		array<int, 3> a;
		cin >> a[0] >> a[1] >> a[2];
		sort(a.begin(),a.end());
		cout << (a[2] * a[2] == a[1] * a[1] + a[0] * a[0]
				? "YES" : "NO") << endl;
	}
}

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

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


    }
    return 0;
}

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

int main(){
	int abc[3];
	while(cin >> abc[0] >> abc[1] >> abc[2]){
		while(!(((abc[0] >= 1)&&(abc[0] <= 1000))&&
				((abc[1] >= 1)&&(abc[1] <= 1000))&&
				((abc[2] >= 1)&&(abc[2] <= 1000)))){
			cout << "\nwrong value\n";
			cin >> abc[0] >> abc[1] >> abc[2];
		}
		sort(abc, abc+3);
		if((pow(abc[0], 2) + pow(abc[1], 2)) == pow(abc[2], 2)){
			cout << "\nYES\n";
		}else{
			cout << "\nNO\n";
		}
	}
    return 0;
}

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

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

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


	return 0;
}

C++: // This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <stdio.h>

int main()
{
int n;
    scanf("%d",&n);
    
    for(int i=0;i<n;i++){
int a;
int b;
int c;
    scanf("%d",&a);
    scanf("%d",&b);
    scanf("%d",&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");
}
        
}
}
// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://msdn.microsoft.com/library/3bstk3k5.aspx
//   http://www.cplusplus.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   http://www.boost.org/doc/

C++: #include <stdio.h>
#include <stdbool.h>

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

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

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

using namespace std;

void bigger(int *x, int *y);

int main(void){
	int data;
	int n1, n2, n3;
	cin >> data;
	for(int i = 0; i < data; i++){
		scanf("%d %d %d", &n1, &n2, &n3);
		bigger(&n1, &n2);
		bigger(&n1, &n3);
		
		if(n1* n1 == n2*n2 + n3*n3)
		cout << "YES" << endl;
		else
		cout << "NO" << endl;
		
	}
	return 0;
}

void bigger(int *x, int *y){
	if(*y > *x){
		int type = *x;
		*x = *y;
		*y = type;
	}
}

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

int main()
{
        using namespace std;
        deque<int> edge;
        int iedge[3];
        int j;
        int a,b,c;

        cin >> j;

        for(int l=0;l<j;l++){
                for(int i=0;i<3;i++){
                        cin >> iedge[i];
                edge.push_back(iedge[i]);
                }

                sort(edge.begin(),edge.end());
                a = edge[0];
                b = edge[1];
                c = edge[2];
                if(c*c == (a*a+b*b))cout << "YES\n";
                else cout << "NO\n";

                edge.clear();

        }

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

C++: #include <stdio.h>

int main(void) {
	int a, b, c, i ,j;
	scanf("%d", &j);
	for(i= 1; i <= j ;i++){
		scanf("%d%d%d", &a, &b, &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");
		}
	}
	
	return 0;
}