Go: package main
import (
        "fmt"
)

func main() {
        var num int
        fmt.Scan(&num)

        for i := 0; i < num; i++ {
                s1 := 0
                s2 := 0
                s3 := 0
                var chk int = 0
                fmt.Scanf("%d %d %d", &s1, &s2, &s3)
                if s1 >= s2 {
                        if s1 > s3 {
                                chk = 1
                        } else {
                                chk = 3
                        }
                } else {
                        if s2 >= s3 {
                                chk = 2
                        } else {
                                chk = 3
                        }
                }

                if (chk == 1 && s1*s1 == s2*s2 + s3*s3) ||
                        (chk == 2 && s2*s2 == s3*s3 + s1*s1) ||
                        (chk == 3 && s3*s3 == s1*s1 + s2*s2) {
                        fmt.Printf("YES\n")
                } else {
                        fmt.Printf("NO\n")
                }
        }
}

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;
}

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=0; i<n; i++){
        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\n";
        else cout<<"NO\n";
    }
    return 0;
}