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>
using namespace std;

int main(){
	int n,a,b,c;
	cin>>n;
	while(cin>>a>>b>>c){
		if(a*a==b*b+c*c || b*b==a*a+c*c || c*c==a*a+b*b){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
	}

	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
int main() {
	int n;
	std::cin >> n;
	std::vector<std::string>v;
	for (int i = 0;i < n;++i) {
		int a, b, c;
		std::cin >> a >> b >> c;
		int max = std::max(a,std::max(b,c));
		if (a*a + b*b + c*c == max*max * 2) {
			v.push_back("YES");
		}
		else {
			v.push_back("NO");
		}
	}
	for (int i = 0;n < i;++i) {
		std::cout << v[i] << std::endl;
	}
	return 0;
}

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

int main()
{
  int n;
  cin >> n;
  vector<int> tri(3);

  while(n > 0) {
    cin >> tri[0] >> tri[1] >> tri[2];
    sort(tri.begin(), tri.end());
    if(pow(tri[0], 2) + pow(tri[1], 2) == pow(tri[2], 2))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    n--;
  }
  return 0;
}

C++: #include<stdio.h>
#define MAX_N 1000

int main() {

	int i = 0;
	int N = 0;
	int a[MAX_N], b[MAX_N], c[MAX_N];

	scanf("%d", &N);

	for(i = 0; i < N; i++) {
		scanf("%d %d %d", &a[i], &b[i], &c[i]);
	}

	for(i = 0; i < N; i++) {

		if(a[i] * a[i] + b[i] * b[i] == c[i] * c[i]) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}

	return 0;
}

C++: #include <iostream>

void judgeTriangle(int, int, int);

int main()
{
    int number;
    std::cin >> number;
    for (int i = 0; i < number; ++i) {
        int a, b, c;
        std::cin >> a >> b >> c;
        judgeTriangle(a, b, c);
    }
    return 0;
}

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

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
int main(){
	int N,i;
	int count=0;
	int a[3];
	scanf("%d ",&N);
	while(count!=N){
	for(i=0;i<3;i++){
		scanf("%d ",&a[i]);
	}
	sort(a,a+3);
	if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1]){
		printf("YES\n");
		count++;
	}
	else{
		printf("NO\n");
		count++;
	}
	}
	return 0;
	}

C++: #include <bits/stdc++.h>

bool isRightTriangle(const int &a, const int &b, const int &c)
{
    int sum = a * a + b * b + c * c;
    int max = std::max(a, std::max(b, c));
    return (sum - (max * max) == max * max);


}

int main()
{
    int N, a, b, c;
    std::scanf("%d", &N);
    for (int i = 0; i < N; i++) {
        std::scanf("%d %d %d", &a, &b, &c);
        (isRightTriangle(a, b, c)) ? std::cout << "YES" << std::endl : std::cout << "NO" << std::endl;
    }
    return 0;
}

C++: #include<stdio.h>
int main(){
  int n,i,j;
  scanf("%d",&n);
  int a[n],b[n],c[n];
  for(i=0;i<n;i++){
    scanf("%d %d %d",&a[i],&b[i],&c[i]);
  }
  for(i=0;i<n;i++){
    j=0;
    if(a[i]*a[i]+b[i]*b[i]==c[i]*c[i]){
      printf("YES\n");
      j++;
    }
    if(a[i]*a[i]+c[i]*c[i]==b[i]*b[i]){
      printf("YES\n");
      j++;
    }
    if(c[i]*c[i]+b[i]*b[i]==a[i]*a[i]){
      printf("YES\n");
      j++;
    }
    if(j==0){
      printf("NO\n");
    }
  }
  return(0);
}

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

int main()
{
	int a[3],n;
	cin>>n;
	while(n>0){
		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");
		}
		n--;
	}
	return 0;
}

C++: #include<stdio.h>
 
int main() 
{
 int x,y,z,n,tmp; 
 tmp=0;
 scanf("%d",&n); 

while(n-->0)
 { 
scanf("%d",&x);scanf("%d",&y);scanf("%d",&z);  

if(x<y){tmp=y;y=x;x=tmp;} 
if(x<z){tmp=x;x=z;z=tmp;}
 if(y<z){tmp=z;z=y;y=tmp;} 

if(x*x==y*y+z*z)printf("YES\n");
 else printf("NO\n");     
} 
return 0; 
}

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

inline bool is_right_triangle(int a, int b, int c){
	return (a*a == b*b + c*c || b*b == a*a + c*c || c*c == a*a + b*b) ? true : false;
}


int main() {
	ios::sync_with_stdio(false);
	int n, a, b, c;
	cin >> n;
	for(int i=0; i<n; i++){
		cin >> a >> b >> c;
		if(is_right_triangle(a,b,c)) cout << "YES" << "\n";
		else cout << "NO" << "\n";
	}

}

C++: #include <iostream>

using namespace std;

int main()
{
	int a,b, c,i,count;
	bool ret;
	scanf("%d",&count);
	for(i = 0; i < count; i++ ) {
		cin >> a >> b >> c;
		a *= a;
		b *= b;
		c *= c;
		ret = false;
		if( a + b == c ){
			ret = true;
		}
		else if( a + c == b ) {
			ret = true;
		}
		else if ( b + c == a ) {
			ret = true;
		}
		
		if( ret == true ) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}	
	}

	return 0;
}

C++: #include <iostream>

#include <vector>

#include <algorithm>

using namespace std;



int main() {

    int N;

    cin >> N;

    vector<int> sides(3);

    for (int n = 0; n != N; ++n) {

        cin >> sides[0] >> sides[1] >> sides[2];

        sort(sides.begin(), sides.end());

        if (sides[0]*sides[0] + sides[1]*sides[1] == sides[2]*sides[2]) {

            cout << "YES" << endl; 

        }

        else {

            cout << "NO" << endl;

        }

    }

    return 0;

}

C++: #include <iostream>

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

C++: 
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
	int N,d[1010],i=0,j=0;
	float a,b,c;
	cin>>N;
	j=N;
		while(j--)
		{
			cin>>a>>b>>c;
			if (a*a+b*b==c*c)
				//d[i]=1;
				cout<<"YES"<<endl;
			else
				cout<<"NO"<<endl;
				//d[i]=0;
			//i++;
		}
// 		for (i=0;i<N;i++)
// 		{
// 			if (d[i])
// 				cout<<"YES"<<endl;
// 			else
// 				cout<<"NO"<<endl;
// 		}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  int n;
  cin>>n;
  while(n--){
    int a,b,c;
    cin>>a>>b>>c;
    if(a>b)swap(a,b);
    if(b>c)swap(b,c);
    if(a*a+b*b==c*c){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}