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 <stdio.h>
  
int triJudgefunc(int x, int y, int z);
  
int main(void)
{
    int row;
    scanf("%d", &row);
    for (int i = 0; i < row; ++i) {
        int firstn, secondn ,thirdn; 
        scanf("%d %d %d", &firstn, &secondn, &thirdn);
        if (triJudgefunc(firstn, secondn, thirdn) = true) {
        printf("YES\n");
        } else {
        printf("NO\n");
        }
    }
    return 0;
}
  
  
  
int triJudgefunc(int x, int y, int z)
{
    int maxlength, notmax1, notmax2;
    if (x > y) {    //x > y
        if (x > z) {
            maxlength = x, notmax1 = y, notmax2 = z;    //x???max
        } else {
            notmax1 = x, notmax2 = y, maxlength = z;    //z???max
        }
    } else {    //y > x
        if (y > z) {
            notmax1 = x, maxlength = y, notmax2 = z;    //y???max
        } else {
            notmax1 = x, notmax2 = y, maxlength = z;    //z???max
        }
    }
    double result = maxlength * maxlength - notmax1 * notmax1 - notmax2 * notmax2;
    return result;
}

C++: #include<iostream>

using namespace std;

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

  if(a>c){
    tmp=a;
    a=c;
    c=tmp;
  }
  if(b>c){
    tmp=b;
    b=c;
    c=tmp;
  }

  if(a*a+b*b==c*c)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}

C++: #include<stdio.h>
int main(void)
{
    int a[3],b,n,i,x,y;
	scanf("%d",&b);
    for(n=0;n<b;n++){
		for(i=0;i<3;i++){
		scanf("%d",&a[i]);
		}
		for(i=0;i<2;i++){
		    for(x=i+1;x<3;x++){
			    if(a[i]<a[x]){
				    y=a[i];
					a[i]=a[x];
					a[x]=y;
				}
			}
		}
		for(i=0;i<3;i++){
			a[i]=a[i]*a[i];
        }
	//	printf("%d\n",x);
		if(a[0]==a[1]+a[2]){
		    printf("YES\n");
		}
		else{
		    printf("NO\n");
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
bool CheckT(int a,int b,int c);

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

	}
	return 0;
}

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

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

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

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

int main() {
  int sides[3];
  int num;

  cin >> num;
  int sumSidesSq=0;
  for(int i=0; i<num; i++) {
    int maxIndex=0, maxValue=0;
    for(int j=0; j<3; j++) {
      cin >> sides[j];
      if(sides[j] > maxValue) {
        maxValue = sides[j];
        maxIndex = j;
      }
    }

    sumSidesSq = 0;
    for(int j=0; j<3; j++) {
      if(j == maxIndex)
        sumSidesSq -= sides[j]*sides[j];
      else
        sumSidesSq += sides[j]*sides[j];
    }
    cout << ( (sumSidesSq == 0) ? "YES" : "NO" ) << endl;
  }
  return 0;
}

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

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

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int a[3]; //a[0],a[1],a[2]
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 2);
		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    int n1,n2,n3;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>n1>>n2>>n3;
        if(n1*n1==n2*n2+n3*n3){
            cout<<"YES"<<endl;
        }else if(n2*n2==n1*n1+n3*n3){
            cout<<"YES"<<endl;
        }else if(n3*n3==n1*n1+n2*n2){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}

C++: #include<stdio.h>
#include<math.h>
int main(void)
{
	int k[10０0][3],ct;
	int mem;
	scanf("%d",&ct);
	for(int f1=0;f1<ct;f1++){
		scanf("%d %d %d",&k[f1][0],&k[f1][1],&k[f1][2]);
	}
	for(int f=0;f<ct;f++){
		for(int f1=0;f1<3;f1++){
			for(int f2=0;f2<3;f2++){
				if(k[f][f1]>k[f][f2]){
					mem=k[f][f1];
					k[f][f1]=k[f][f2];
					k[f][f2]=mem;
				}
			}
		}
	}
	for(int f1=0;f1<ct;f1++){
		if(pow((double)k[f1][0],2)==pow((double)k[f1][1],2)+pow((double)k[f1][2],2)){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include <stdio.h>

int main(void)
{
	int a,b,c;
	int i;
	
	scanf("%d %d %d",&a,&b,&c);
	
	if(0.0 == (double)(a*a + b*b - c*c)/(2*a*b))
	{
		printf("YES\n");
	}
	else if(0.0 == (double)(b*b + c*c - a*a)/(2*b*c))
	{
		printf("YES\n");
	}
	else if(0.0 == (double)(c*c + a*a - b*b)/(2*c*a))
	{
		printf("YES\n");
	}
	else
	{
		printf("NO\n");
	}
	
	return 0;
}

C++: #include <iostream>

char detClass(int pm, int pe, int pj)
{
	
	int mean = pm + pe + pj;
	if((pm == 100) | (pe == 100) | (pj == 100)) {
		return 'A';
	} else if( (pm + pe) >= 180) {
		return 'A';
	} else if( mean >= 240) {
		return 'A';
	} else if( mean >= 210) {
		return 'B';
	} else if( (mean >= 150) && ((pm >= 80) | (pe >= 80))) {
		return 'B';
	} else {
		return 'C';
	}
}

int main()
{
	int n, pm, pe, pj = 0;
	
	while(true) {
		std::cin >> n;
		if(n == 0) {
			break;
		}
		for(int i = 0; i < n; i++) {
			std::cin >> pm >> pe >> pj;
			std::cout << detClass(pm,pe,pj) << std::endl;
		}
	}
	return 0;	
}

C++: #include<iostream>
using namespace std;
int main(){
    int n,a,b,c,i,j;
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a>>b>>c;
        if(a>1000||b>1000||c>1000){
            break;
        }
        if(b*b+a*a-c*c==0){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }
    return 0;
}

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

int n;
int edge[3];

int main() {
	std::cin >> n;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < 3; ++j)
			std::cin >> edge[i];
		std::sort(edge, edge + 3);

		if (edge[2] * edge[2] == edge[0] * edge[0] + edge[1] * edge[1])
			std::cout << "YES" << std::endl;
		else
			std::cout << "NO" << std::endl;
	}
		return 0;
}