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<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<math.h>
#define L(_i,_N) for(int _i=0;_i<_N;_i++)
typedef long long int lli;
using namespace std;

int main() {
	int N,Line[3];
	cin >> N;
	L(i, N) {
		L(j, 3) cin >> Line[j];
		sort(Line, Line + 3);
		if (pow(Line[0], 2) + pow(Line[1], 2) == pow(Line[2], 2)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

int main(){
	int n;
	cin>>n;
	int i;
	for ( i = 0; i < n; i++ ){
	int a;
	int b;
	int c;
	cin>>a>>b>>c;
	int aa=a*a;
	int bb=b*b;
	int cc=c*c;
	if(aa==bb+cc){
	cout<<"YES"<<endl;}else
	if(bb==aa+cc){
	cout<<"YES"<<endl;}else
    if(cc==bb+aa){
	cout<<"YES"<<endl;}else
	{cout<<"NO"<<endl;}}
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <list>
#include <cmath>
#include <fstream>
#include <queue>
#include <sstream>
#include <algorithm>
#include <cstring>
using namespace std;

template <class T> void change(T &a, T &b)// 交&#25442;
{
	T temp;
	temp = a;
	a = b;
	b = temp;
}
template <class T> void quicksort(vector<T> &S,int a,int b) // 快速排序
{
     int x = a;
	 int y = b;
	 T mid = S[(a+b)>>1];
     while (x <= y)
     {
           while (S[x] < mid) x++;
           while (S[y] > mid) y--;
           if (x <= y)
           {
              change(S[x], S[y]);
              x++;
              y--;
           }
     }
     if (x < b) quicksort(S, x, b);
     if (y > a) quicksort(S, a, y);
}

int main()
{
	vector<int> v(3);
	int ncase;
	cin >> ncase;
	while(ncase--)
	{
		cin >> v[0] >> v[1] >> v[2];
		quicksort(v,0,2);
		bool flag = (v[0]*v[0] + v[1]*v[1] == v[2]*v[2]);
		cout << (flag? "YES" :"NO") << endl;
	}
	return 0;
}

C++: #include <iostream>

usingnamespace std;

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

C++: #include <stdio.h>
#include <algorithm>
#include <string.h>
using namespace std;
int main(void)
{
    int testCase,a[4],index,i;
    scanf("%d",&testCase);
    while(testCase--){
        scanf("%d",&a[0]);
        a[0];
        index = 0;
        for(i=1;i<3;i++){
            scanf("%d",&a[i]);
            if(a[i]>a[i-1])index = i;
            a[i];
        }
        int sum1 = 0;
        int sum2 = 0;
        for(i=0;i<3;i++){
            if(i==index)sum1+=a[i]*a[i];
            else sum2 += a[i]*a[i];
        }
        if(sum1==sum2)printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}

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

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

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

int main(){
	int d;
	cin>>d;
	while(d>0){
		int num[3];
		for(int i = 0 ; i < 3 ; i++ )
		{
			cin>>num[i];
		}
		for(int i = 0 ; i < 3 ; i++)
		{
			for(int j = i+1; j < 3 ; j++)
			{
				if( num[i] > num[j] )
				{
					int q = num[i];
					num[i] = num[j];
					num[j] = q;
				}
			}
		}
		if( num[2]*num[2] - num[1]*num[1] == num[0]*num[0] )
		{
			cout<<"OK"<<endl;
		}else{
			cout<<"NG"<<endl;
		}
		d--;
	}
}

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

int main()
{
	std::vector<int> vec1, vec2, vec3;
	int n, a, b, c;
	std::cin >> n;
	for (int i = 0; i < n; ++i)
	{
		std::cin >> a >> b >> c;
		vec1.push_back(a), vec2.push_back(b), vec3.push_back(c);
	}
	for (int i = 0; i < n; ++i)
	{
		if ((vec1[i] * vec1[i] + vec2[i] * vec2[i] == vec3[i] * vec3[i]) 
			|| (vec2[i] * vec2[i] + vec3[i] * vec3[i] == vec1[i] * vec1[i])
			|| (vec1[i] * vec1[i] + vec3[i] * vec3[i] == vec2[i] * vec2[i]))
			std::cout << "YES" << std::endl;
		else
			std::cout << "NO" << std::endl;
	}

	return 0;
}

C++: #include <stdio.h>

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

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

  return 0;
}

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

C++: #include <stdio.h>

int f;
void judge(int x, int y, int z)
{    
    if (x * x + y * y == z * z){
        f = 1;
    }  
}


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

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

using namespace std;


#define REP(i,n) for(ll i=0;i<n;++i)
#define RREP(i,n) for(ll i=n-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<n;++i)
#define RFOR(i,m,n) for(ll i=n-1;i>=m;--i)
#define ALL(v) (v).begin(),v).end()

#define PB(a) push_back(a)
#define MOD 1000000007

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;cin>>n;
  std::vector<int> v(3);
  for(int i=0;i<3;i++) cin>>v[i];
  sort(v.begin(),v.end());
  if(v[0]+v[1]>v[2]) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
  return 0;
}

C++: #include <stdio.h>

int a ;
int b ;
int c ;
int T ;

int main ( )
{
	while ( scanf ( "%d" , &T ) == 1 ) {
		while ( T-- ) {
			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" ) ;
			}
		}
	}
}

C++: #include <iostream>
using namespace std;
int main(){

	int a;
	int b;
	int c;

	int n;
	cin >> n;

	for(int i=1; i<=n; i++){

		cin >> a >> b >> c;

		if(a*a+b*b==c*c){

			cout << "Yes\n";

		}
		else {
			cout << "No" << endl;
		}
	}
}

C++: 





#include <iostream>
#include <algorithm>
#include <cstdio>

using namespace std;

#define COMPARE(left , right)   (left == right ? "YES" : "NO")
#define SQUARE(value)			(value * value)
#define SIZE	3

int main(void)
{
	int ansArray[SIZE] = {0};
	int n;

	cin >> n;

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < SIZE; j++)
		{
			cin >> ansArray[j];
		}

		sort(ansArray , ansArray + SIZE);

		cout << COMPARE(SQUARE(ansArray[0]) +SQUARE( ansArray[1]) , SQUARE(ansArray[2])) << endl;
	}

	return 0;
}