Go: package main

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

func main() {
	n, _ := strconv.Atoi(strScan())
	scanner := bufio.NewScanner(os.Stdin)
	for i := 0; i < n; i++ {
		scanner.Scan()
		strArr := strings.Fields(scanner.Text())
		castNumArr := StringToInt(strArr)
		fmt.Println(checkTriangle(castNumArr))
	}
}

func checkTriangle(i []int) string {
	if checkSt(i[0], i[1], i[2]) || checkSt(i[1], i[2], i[0]) || checkSt(i[2], i[0], i[1]) {
		return "YES"
	} else {
		return "NO"
	}
}

func Sq(x int) int {
	return x * x
}

func checkSt(a, b, c int) bool {
	return (Sq(a) + Sq(b)) == Sq(c)

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++)
		{
			Array arr(3);
			readAll(arr, n);
			cout << "YES" << endl;
			//sort(ALL(arr));
			//cout << (arr[2] * arr[2] == arr[0] * arr[0] + arr[1] * arr[1] ? "YES" : "NO") << endl;
		}
	}
	return 0;
}

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

int main(){

	int a[3];

	while(std::cin >> a[0] >> a[1] >> a[2]){
		std::sort(a,a+3);
		if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1]){
			std::cout << "YES" << std::endl;
		}
		else{
			std::cout << "NO" << std::endl;
		}
	}
}

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

int main(){
	int n, a, b, c, ma, sum, rst;
	
	cin >> n;
	
	for(int i=0;i<n;i++){
		cin >> a >> b >> c;
		a*=a; b*=b; c*=c;
		sum=a+b+c;
		ma=max(a,max(b,c));
		rst=sum-ma;
		if(rst==ma) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	
	return 0;
}

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

#define Triangle(s1,s2,s3) if(s1*s1+s2*s2==s3*s3)
using namespace std;

int main()
{
	int n;
	int h[3];
	vector<int> side;
	int i;
	
	cin >> n;
	
	for(i=0;i<n;i++)
	{
		side.clear();
		
		for(int j=0;j<3;j++)
		{
			cin >> h[i];
			side.push_back(h[i]);
		}
		
		sort(side.begin(),side.end());
		
		Triangle(side[0],side[1],side[2])
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}

C++: #include <iostream>
 
 
bool judging(int x, int y, int z)  //widthes of three edges
{
    if (x * x + y * y == z * z) {
        return true;
    } else if (z * z + x * x == y * y) {
        return true;
    } else if (y * y + z * z == x * x) {
        return true;
    } else {
        return false;
    }
}
 
 
int main()
{
    int a, b, c, n;  //the number of lines
    std::cin >> n;
    for (int i = 0; i < n; i++) {
        std::cin >> a >> b >> c;
        if (judging(a, b, c)) {
            std::cout << "YES" << std::endl;
        } else {
            std::cout << "NO" << std::endl;
        }
    }
}

C++: 
/*
 * main.cpp
 *
 *  Created on: 2011/04/01
 *      Author: satoki
 *      21:47 ~ 22:08
 */
#include <iostream>
#include <string.h>
using namespace std;

int iN;
int iTra[3];
bool bOutput;

bool input() {
  if (iN > 0)
    scanf("%d %d %d", &iTra[0], &iTra[1], &iTra[2]);
  else
    return false;
  iN--;
  return true;
}

void manage() {
  int i, j, tmp;
  for (i = 0; i < 3; i++) {
    iTra[i] *= iTra[i];
  }
  for (i = 0; i < 3; i++) {
    for (j = 2; j > i; j--) {
      if (iTra[j - 1] > iTra[j]) {
        tmp = iTra[j - 1];
        iTra[j - 1] = iTra[j];
        iTra[j] = tmp;
      }
    }
  }
  if (iTra[0] + iTra[1] == iTra[2])
    bOutput = true;
  else
    bOutput = false;
}

int main() {
  scanf("%d", &iN);
  while (1) {
    if (!input()) break;
    manage();
    if (bOutput)
      printf("YES\n");
    else
      printf("NO\n");
  }
}

C++: #include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

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

C++: #include <stdio.h>
int main() {int N,a,b,c;for (scanf("%d",&N);N--;) {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)) puts("YES"); else puts("NO");}return 0;}

C++: #include <iostream>
using namespace std;
 
int main()
{
   int a,b,c,x, y, z,n;
 
   // read in n 
   cin>>n;

   // for n set of data, read into 3 sides 
   
   for(int i=1;i<=n;i++)
   {
      cin>>a>>b>>c;          
      x=a*a; y=b*b; z=c*c;
      
      // check if they are triangle
      if(x+y==z||x+z==y||y+z==x)
          cout<<"Yes"<<endl;
      else
          cout<<"No"<<endl;
    }   
    return 0;
}

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

int main(){
    int a,b,c,d;
    while(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(void) {
	int i=1, j, max, a[3],kaisu;
	cin >> kaisu;
	while (1) {
		cin >> a[0] >> a[1] >> a[2];
		if (a[0] >= a[1] && a[0] >= a[2]) {
			if (a[0] * a[0] == a[1] * a[1] + a[2] * a[2])
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
		else if (a[1] >= a[0] && a[1] >= a[2]) {
			if (a[1] * a[1] == a[2] * a[2] + a[0] * a[0])
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
		else
		{
			if (a[2] * a[2] == a[1] * a[1] + a[0] * a[0])
				cout << "YES" << endl;
			else
				cout << "NO" << endl;

		}

		if (i == kaisu)break;
		i++;
	}
	return 0;
}

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

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

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

C++: #include <cstdio>
#include <queue>
#include <vector>

using namespace std;

bool Check(int n,int m,int l){
	if(n == m && m == l && l == n){ return false; }
	priority_queue<int> q;
	q.push(n);
	q.push(m);
	q.push(l);
	int a,b,c;
	c = q.top();
	q.pop();
	b = q.top();
	q.pop();
	a = q.top();
	q.pop();
	if(a * a + b * b == c * c){
		return true;
	}else{
		return false;
	}
}

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

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