Go: package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	n := nextInt()
	for i := 0; i < n; i++ {
		data := nextInts(3)
		fmt.Fprintln(out, checkTriangle(data))
	}
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

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"
	}
	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>
using namespace std;
int main() {
	int a[3];
	int n;
	cin>>n;
	while(0<n){
		cin>>a[1]>>a[2]>>a[3];
		sort(a,a+2);
		if(a[1]*a[1]+a[2]*a[2]==a[3]*a[3]){
			cout<<"YES"<<endl;
		}else {
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int a[10000] = { 0 }, b[10000] = { 0 }, c[10000] = { 0 };
	int n,i;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> a[i] >> b[i] >> c[i];
	}
	int d[10000], e[10000], f[10000],g[10000];
	d[i] = a[i] * a[i];
	e[i] = b[i] * b[i];
	f[i] = c[i] * c[i];
	g[i] = d[i] + e[i] + f[i];
	for (int j = 0; j < n; j++) {
		if (g[j] == 2*d[j] || g[j] == 2*e[j] || g[j] == 2*f[j]) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

using namespace std;

int main(){
	int n,a,b,c;
	int m=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int a[3];
		for(int j=0;j<3;j++)scanf("%d",&a[j]);
		std::sort(a,a+3);
		
		int d = 31;
		if(a[0]>d || a[1]>d || a[2]>d)puts("hogehogehoge");
		
		if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]){
			puts("YES");
		}else{
			puts("NO");
		}
	}
}

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

using namespace std;

int main()
{
	int n;

	scanf("%d",&n);

		while(n--)
		{
			int a[3];
		
			scanf("%d %d %d",&a[0],&a[1],&a[2]);
			sort(a,a+3);

			if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1])
				printf("YES\n");

			else
				printf("NO\n");
		}
	
}

C++: #include <iostream>

bool judgement(int a, int b, int c)
{
	if (a*a == b*b + c*c) {
		return true;
	} else {
		return false;
	}
}

int main()
{
	while (true) {
	    static int x;
	    static int y;
	    static int z;
	    static bool flag[3];
	    std::cin >> x >> y >> z;
	    flag[0] = judgement(x, y, z);
	    flag[1] = judgement(y, z, x);
	    flag[2] = judgement(z, x, y);
	    if (flag[0] || flag[1] || flag[2]) {
	    	std::cout << "YES" << std::endl;
	    	} else {
	    		std::cout << "NO" << std::endl;
	    		}
	   }
}

C++: import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class Main {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);

	static void solve() {
		int n = in.nextInt();

		while (n-- > 0) {
			int a = in.nextInt();
			int b = in.nextInt();
			int c = in.nextInt();

			if (a*a == b*b + c*c || b*b == c*c + a*a || c*c == a*a + b*b) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}

	public static void main(String[] args) {
		long start = System.currentTimeMillis();

		solve();
		out.flush();

		long end = System.currentTimeMillis();
		//trace(end-start + "ms");
		in.close();
		out.close();
	}

	static void trace(Object... o) { System.out.println(Arrays.deepToString(o));}
}

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

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

using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T1, class T2> inline void minup(T1& m, T2 x){ if(m>x) m=static_cast<T2>(x); }
template<class T1, class T2> inline void maxup(T1& m, T2 x){ if(m<x) m=static_cast<T2>(x); }

#define INF 1000000000
#define MOD 1000000009
#define EPS 1E-9

int n;
int a[3];

int main()
{
  cin >> n;
  while(n--){
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a+3);
    puts((a[0]*a[0]+a[1]*a[1]==a[2]*a[2]) ? "YES" : "NO");
  }

  return 0;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long Int;

int main() {
    int T;
    scanf("%d", &T);
    while (T--) {
        int a[3];
        rep (i, 3) scanf("%d", a+i);
        sort(a, a+3);
        bool ans = ((Int)a[0]*a[0]+(Int)a[1]*a[1] == (Int)a[2]*a[2]);
        puts(ans ? "YES" : "NO");
    }
    return 0;
}

C++: #include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
using namespace std;
 /*temp*/

int main(){
    int n, j;
    int a[3];
    cin >> n;
    REP(i, n){
        cin >> a[0] >> a[1] >> a[2];
        sort(a, a+3);
        if(a[0]*a[0] +a[1]*a[1]==a[2]*a[2])
            printf("YES\n");
        else
            printf("NO\n");
    }
}

C++: #include <iostream>

using namespace std;
int loop;
int panjang[1000][3];
int y = 0;
int temp;
int main()
{
 cin >> loop;
for(int x=0;x<loop;x++)
{
        cin >> panjang[x][y] >> panjang[x][y+1] >> panjang[x][y+2];
        if(panjang[x][y]>1000||panjang[x][y]<1||panjang[x][y+1]>1000||panjang[x][y+1]<1||panjang[x][y+2]>1000||panjang[x][y+2]<1)
            return 0;
}
for(int looper= 0;looper<loop;looper++)
{
    for(int looper2 = 0;looper2<5;looper2++)
{
    if((panjang[looper][y])<(panjang[looper][y+1]))
    {
        temp = panjang[looper][y];
        panjang[looper][y]=panjang[looper][y+1];
        panjang[looper][y+1]=temp;
        temp = 0;
            if((panjang[looper][y+1]<(panjang[looper][y+2])))
    {
        temp = panjang[looper][y+1];
        panjang[looper][y+1]=panjang[looper][y+2];
        panjang[looper][y+2]=temp;
        temp = 0;

    }

    }
}
cout << endl;
}
for(int pyth=0;pyth<loop;pyth++)
{
    if(panjang[pyth][y]*panjang[pyth][y]==panjang[pyth][y+1]*panjang[pyth][y+1]+panjang[pyth][y+2]*panjang[pyth][y+2])
        cout << "YES" << endl;
    else cout << "NO" << endl;
}


}

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

bool check_right_tri(int a,int b,int c){

  int max = std::max({a,b,c});

  if(max == a && a*a == b*b + c*c)
    return true;
  else if(max == b && b*b == a*a + c*c)
    return true;
  else if(max ==c && c*c == a*a + b*b)
    return true;
  else return false;
}

int main(){
  const int min = 1;
  const int max = 1000;
  const int data_max = 1000;
  int a,b,c,N;
  std::cin >> N;

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