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<iostream>
#include<algorithm>
#include<functional>
using namespace std;

string isTriangle(int a[3]);

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

C++: #include<iostream>
#include<string>
using namespace std;
string heihou(int a,int b,int c)
{
	if (a*a == b*b + c*c || b*b == a*a + c*c || c*c==a*a+b*b){
		return "YES";
	}
	else{
		return "NO";
	}
}
int main()
{
	int dataset[999][2];
	int i = 0;
	int l;
	cin >> l;
	while (i<l){
		cin >> dataset[i][0] >> dataset[i][1] >> dataset[i][2]; 
		i++;
	}
	for (int j = 0; j < i; j++){
		cout << heihou(dataset[j][0], dataset[j][1], dataset[j][2])<< endl;
	}
	getchar();
	getchar();
	return 0;
}

C++: #include<stdio.h>

void swap(int *x,int *y)
{
	int temp = *x;
	*x=*y;
	*y=temp;
}

int main()
{
	int count;
	scanf("%d",&count);

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

}

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

C++: #include<iostream>
#include<string>
//0001
#include<cstddef>
#include<queue>
#include<vector>
//0003
#include<algorithm>
using namespace std;

int main() {
	//0000
	/*
	int i, j;

	for (i = 1; i < 10; i++) {
		for (j = 1; j < 10; j++) {
			cout << i << "x" << j << "=" << i*j << endl;
		}
	}
	*/
	//0001
	/*
	int i;
	const size_t MNum = 10;
	int MHeight[MNum];
	int MH1 = 0, MH2 = 0, MH3 = 0;
	for (i = 0; i < 10; i++) {
		cin >> MHeight[i];
		if (MHeight[i] > MH1) {
			MH3 = MH2;
			MH2 = MH1;
			MH1 = MHeight[i];
		}
		else if (MHeight[i] > MH2) {
			MH3 = MH2;
			MH2 = MHeight[i];
		}
		else if (MHeight[i] > MH3) {
			MH3 = MHeight[i];
		}
	}
	cout << MH1 << endl << MH2 << endl << MH3 << endl;
	*/
	/*
	priority_queue<int, vector<int>, less<int> > que;
	int MH;

	for (int i = 0; i < 10; i++) {
		cin >> MH;
		que.push(MH);
	}

	for (int j = 0; j < 3; j++) {
		cout << que.top() << endl;
		que.pop();
	}
	*/
	//0002
	/*
	int a, b;
	while (cin >> a >> b) {
		int sum = a + b;
		int count = 0;
		while (sum > 0) {
			sum = sum / 10;
			count++;
		}
		cout << count << endl;
	}
	*/
	//0003
	int a[3];
	int N;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}


	return 0;
}

C++: main(a,b,c){for(scanf("%*d");~scanf("%d%d%d",&a,&b,&c);puts((a+b-c&&a+c-b&&c+b-a)?"NO":"YES"))a*=a,b*=b,c*=c;}

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

int main(){
	int a,b,c,n;
	cin>>n;
	for (int i = 0; i < n; ++i) {
		cin>>a>>b>>c;
		if(a>b)switch(a,b);
		if(b>c)switch(b,c);
		if(a>b)switch(a,b);
		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 dataNum;
	int hen[1000][3];

	cin >> dataNum;
	for (int i = 0; i < dataNum; i++) {
		cin >> hen[i][0] >> hen[i][1] >> hen[i][2];
	}

	for (int i = 0; i < dataNum; i ++) {

		//????????????????????§?????????
		for (int j = dataNum - 1; j > 0; j--) {
			for (int k = 0; k < j; k++) {
				if (hen[k] > hen[k + 1]) {
					int dummy = hen[i][k];
					hen[i][k] = hen[i][k + 1];
					hen[i][k + 1] = dummy;
				}
			}
		}

		//??´?§?????????§??????
		if (hen[i][0] * hen[i][0] + hen[i][1] * hen[i][1] == hen[i][2] * hen[i][2]) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}

	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<vector>
#include <algorithm>
#include <functional>
#include<cmath>

using namespace std;

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

	return 0;
}

C++: #include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)
#define MP make_pair


int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(10);

  int INF = 1000000;

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

  return 0;
}

C++: #include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdio.h>
#include<cmath>
#include<vector>
#include<utility>
#include<stack>
#include<queue>

#define FOR(i, a, b) for(int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define MOD 1000000007

using namespace std;

int main(void) {
	int n;
	int a[1001], b[1001], c[1001];

	cin >> n;
	FOR(i, 1, n) {
		cin >> a[i] >> b[i] >> c[i];
	}
	FOR(i, 1, n) {
		if (a[i] >= b[i] && a[i] >= c[i]) {
			if (a[i] * a[i] == b[i] * b[i] + c[i] * c[i]) {
				cout << "YES" << endl;
			}
			else {
				cout << "NO" << endl;
			}
		}

		else if (b[i] >= a[i] && b[i] >= c[i]) {
			if (b[i] * b[i] == a[i] * a[i] + c[i] * c[i]) {
				cout << "YES" << endl;
			}
			else {
				cout << "NO" << endl;
			}
		}

		else if (c[i] >= b[i] && c[i] >= a[i]) {
			if (c[i] * c[i] == b[i] * b[i] + a[i] * a[i]) {
				cout << "YES" << endl;
			}
			else {
				cout << "NO" << endl;
			}
		}
	}
	return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int main()
{
	int cant,a,b,hip;
	float cat;
	cin>>cant;
	for(int i=0;i<cant;i++)
	{
		do
		{
			cin>>a>>b>>hip;
		}while(a<1||a>1000||b<1||b>1000||hip<1||hip>1000);
		cat=(a*a)+(b*b);
		if(sqrt(cat)==hip)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}