Go: package main

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

func sliceAtof64(sa []string) ([]float64, error) {
	si := make([]float64, 0, len(sa))
	for _, a := range sa {
		i, err := strconv.ParseFloat(a, 64)
		if err != nil {
			return si, err
		}
		si = append(si, i)
	}
	return si, nil
}

func answer(ans bool) {
	if ans {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
func isRightTriangle(ary []float64) (ans bool) {
	sort.Sort(sort.Reverse(sort.Float64Slice(ary)))
	ans = math.Pow(ary[1], 2.0)+math.Pow(ary[2], 2.0) == math.Pow(ary[0], 2.0)

	return
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	lineCount, _ := strconv.Atoi(scanner.Text())
	lines := make([]string, lineCount)

	for i := 0; i < lineCount; i++ {
		scanner.Scan()
		lines[i] = scanner.Text()
	}

	for _, v := range lines {
		ary, _ := sliceAtof64(strings.Split(v, " "))
		answer(isRightTriangle(ary))
	}
}

C++: #include <cstdio>

int main(){
	int n;
	int a[3];
	scanf("%d",&n);

	for (int i=0;i<n;++i){
		for (int j=0;j<3;++j) scanf("%d",a+j);
		bool z=false;
		for (int k=0;k<3;++k)
			if (a[k]*a[k]+a[(k+1)%3]*a[(k+1)%3]==a[(k+2)%3]*a[(k+2)%3])
				z=true;
		if (z) print("YES\n");
		else print("NO\n");
	}
	return 0;
}

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

using namespace std;

int main() {
  int ct = 0;
  int a[3];

  scanf("%d", &ct);
  for(int i = 0; i < ct; i++) {
    scanf("%d %d %d", &a[0], &a[1], &a[2]);
    sort(a, a + 3);
    printf("%s\n", a[2] * a[2] == a[0] * a[0] + a[1] * a[1] ? "YES" : "NO");
  }
  return 0;
}

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

char const *answer(int a,int b,int c){
	if(c*c == (a*a+b*b))	return "YES";
	else		return "NO";
}

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

int main() {
	int n,a,b,c;
	cin >> n;
	for(int i=0;i<n;i++){
	cin >> a >> b >> c;
	if(a>b) swap(a,b);
	if(b>c) swap(b,c);
	cout << answer(a,b,c) << endl;
	}
}

C++: #include <iostream>
#include <string>
#include <math.h>

using namespace std;

int main(void){
	int n,val[3];

	cin >> n;
	for(int i=0;i<n;i++){
		for(int j=0;j<3;j++)
			cin >> val[j];

		for(int j=0;j<2;j++)
	        	for(int k=0;k<2-j;k++)
        			if(val[k]>val[k+1]){
                			int tmp = val[k];
                			val[k]=val[k+1];
                			val[k+1]=tmp;
				}
		string str = (pow(val[0],2.0)+pow(val[1],2.0)==pow(val[2],2.0))?"YES":"NO";
		cout << str << endl;
	}

	return 0;
}

C++: #include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
  int n,j=0;
  int a[3];
  cin>>n;
    for(int i=0;i<n;i++){
      cin>>a[0]>>a[1]>>a[2];
    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<stdio.h>
#include<iostream>

using namespace std;


int main(){
	int n;
	cin>>n;
	int hen1,hen2,hen3,saidai,max_pos=1;

	for(int i=0;i<n;i++){
		cin>>hen1>>hen2>>hen3;

		saidai=hen1;
		if(saidai<hen2){
			saidai=hen2;
			max_pos=2;
		}
		if(saidai<hen3){
			saidai=hen3;
			max_pos=3;
		}
		switch(max_pos){
		case 1:
			hen1=0;
			break;case 2:
			hen2=0;
			break;case 3:
			hen3=0;
		}
		if(saidai*saidai==hen1*hen1+hen2*hen2+hen3*hen3)
			cout<<"YES"<<"\n";
		else{
			cout<<"NO"<<"\n";
		}
	}
	
	
	return 0;
}

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

using namespace std;

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

C++: #include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int n;
cin >> n;
int a[n][3];
for(int i=1; i<=n; i++){
for(int j=0; j<=3; j++){
cin >>a[i][j];
}
}
for(int i=1; i<=n; i++){
if(((a[i][1]+a[i][2])>=a[i][3]) || ((a[i][1]+a[i][3])>=a[i][2]) || ((a[i][2]+a[i][3])>=a[i][1]))
{
    cout << "YES" << endl;
}
else{cout << "NO" << endl;}
}
}

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

int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int a, b, c;
    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 <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>

using namespace std;

int main()
{
	int a,b,c,n;
	
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>b>>c;

		if(a*a+b*b==c*c) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}

}

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

int main() {
	int a, b, c, n, t[3], s,ss;
	cin >> n;
	for (n; n > 0; n--) {
		cin >> a >> b >> c;
		 t[0]=a;
		if (t[0] < b) {
			t[1] = t[0];
			t[0] = b;
		}
		else t[1] = b;
		if (t[0] <c) {
			t[2] = t[1];
			t[1] = t[0];
			t[0] = c;
		}else if(t[1] <c) {
			t[2] = t[1];
			t[1] = c;
		}
		else t[2] = c;
		s = t[1] * t[1] + t[2] * t[2];
		ss = t[0] * t[0];
			if (s == ss) {
			cout << "YES"<<endl;
		}else cout << "NO"<<endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

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

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

int main()
{
	int n, a[3];
	cin >> n;
	while (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++: nt main(){scanf("%*d");for(int a,b,c;~scanf("%d%d%d",&a,&b,&c);puts(b+c-a?a+c-b?a+b-c?"NO":"YES":"YES":"YES")){a*=a;b*=b;c*=c;}}

C++: #include<stdio.h>
int main(void)
{
	int a,s,z,x,h,d,f,g,i,j;
	scanf("%d",&a);
	for(i=1;i<=a;i++){
		scanf("%d %d %d",&s,&z,&x);
		d=x*x;
		h=s*s+z*z;
		if(s<x&&x<z||x<s&&s<z){
			d=z*z;
			h=s*s+x*x;
		}
		if(z<x&&x<s||x<z&&z<s){
			d=s*s;
			h=z*z+x*x;
		}
		if(d==h){
			printf("YES\n");
		}
		if(d!=h){
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include <iostream>

int main() {
int N;
std::cin >> N;

for (int i = 0; i < N; i++) {
int a, b, c;
std::cin >> a >> b >> c;
int aa = a * a;
int bb = b * b;
int cc = c * c;
if (aa + bb == cc) std::cout << "YES" << std::endl;
else
if (aa + cc == bb) std::cout << "YES" << std::endl;
else
if (bb + cc == aa) std::cout << "YES" << std::endl;
else
std::cout << "NO" << std::endl;

}


return 0;
}

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

int main() {
	int n, a, b, c;
	cin >> n;
	for (int i = 0; i < n; i++) {
		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\n";
		else
			cout << "NO\n";
	}
	return 0;
}

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

bool solve(int x,int y, int z)
{
	if( (x * x) == (y * y + z * z) )
	{
		return true ;
	}

	return false ;
}

int main()
{
	int N ;
	cin >> N ;

	bool ans = false ;

	for( int i = 0 ; i < N ; i ++ )
	{
		int a,b,c ;
		cin >> a >> b >> c ;

		if( a > b )
		{
			if( a > c )		// 最大値はa
			{
				ans = solve(a,b,c) ;
			}
			else if( a < c )	// 最大値はc
			{
				ans = solve(c,a,b) ;
			}
		}
		else if( a < b )
		{
			if( b > c )		// 最大値はb
			{
				ans = solve(b,a,c) ;
			}
			else if( b < c )	// 最大値はc
			{
				ans = solve(c,a,b) ;
			}
		}

		if( ans ){ cout << "YES" << endl ; }
		else{ cout << "NO" << endl ; }
	}
	return 0 ;
}