Go: package main

import "fmt"

func main() {
	var n int

	fmt.Scanf("%d", &n)

	var a, b, c int
	for i := 0; i < n; i++ {
		var isTriangle bool
		fmt.Scanf("%d %d %d", &a, &b, &c)

		if a*a == b*b+c*c || b*b == a*a+c*c || c*c == b*b+a*a {
			isTriangle = true
		}

		if isTriangle == true {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <iostream>

using namespace std;

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

	getchar();
	getchar();
	return  0;
}

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

int l[3][3];

void swap(int a, int b, int c){
	int buf = l[c][a];
	l[c][a] = l[c][b];
	l[c][b] = buf;
}

//bubble
void sort(int c){
	for(int i = 0; i < 2; i++){
		for(int j = i; j < 2; j++){
			if(l[c][j] > l[c][j+1]) swap(j,j+1,c);	
		}
	}
}

int main(){
int buf;

cin >> buf;

for(int i = 0; i < buf; i++){	
	cin >> l[i][0] >> l[i][1] >> l[i][2];
	sort(i);
}

for(int j = 0; j < buf; j++){
	if(l[j][2]*l[j][2] == l[j][0]*l[j][0] +l[j][1]*l[j][1]){
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}
}

return 0;
}

C++: #include <iostream>

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

int main(int argc, char *argv[])
{
    int dataSize;
    std::cin >> dataSize;

    int side[3];

    for(int i=0; i<dataSize; i++){
        for(int a=0; a<3;a++){
            std::cin >> side[a];
        }

        for(int b = 0; b< 3; b++){
            for(int j=i+1; j<3;j++){
                if(side[i] > side[j]){
                    int tmp = side[i];
                    side[i] = side[j];
                    side[j] = tmp;
                }
            }
        }

        checkTringle(side[2],side[1],side[0]);
    }
}

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

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

C++: #include <iostream>


using namespace std;
 
int main()
{

	int a, b, c, d;
	cin >> a >> b >> c;

	d = c * c;

	if ( d == ( a * a ) + ( b * b ) ) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	
	return 0;
}

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

int main()
{
  int n,a,b,c;

  cin >> n;

  while(n--)
    {
      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;
	}
    }
}

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

int main(){

	int a,b,c,n;
	cin >> n;

	for(int i=0; i<n;i++){
		while(cin>>a>>b>>c){
			if(a*a+b*b==c*c) cout << "Yes" << endl;
			else if(a*a+c*c==b*b) cout << "Yes" << endl;
			else if(b*b+c*c==a*a) cout << "Yes" << endl;
			else cout << "No" << endl;
		}
	}

	int stop;
	cin >> stop;

    return 0;
}

C++: #include <iostream>

bool is_right_triangle(const int a, const int b, const int c)
{
    bool ret;
    int aa;
    int bb;
    int cc;
    
    aa = a * a;
    bb = b * b;
    cc = c * c;
    
    if (aa + bb == cc || bb + cc == aa || cc + aa == bb){
        ret = true;
    }
    else {
        ret = false;
    }
    
    return ret;
}

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

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

int main(){
	int a,b,c;
	int n;
	cin>>n;
	string answer[10000];
	for(int i=0;i<n;i++){
		cin>>a>>b>>c;
		if((a^2)==(b^2)+(c^2)||(b^2)==(c^2)+(a^2)||(c^2)==(a^2)+(b^2)){
			answer[i]="YES";}
		else answer[i]="NO";
	}
	for(int j=0;j<n;j++){
		cout<<answer[j]<<endl;
	}
}

C++: #define D(x) cout << #x " = " << x << endl
#define DD(x, y) cout << "(" #x ", " #y ") = (" << x << ", " << y << ")" << endl
#define DDD(x, y, z) cout << "(" #x ", " #y ", " #z ") = (" << x << ", " << y << ", " << z << ")" << endl
#define DV(v) for (auto __macro_vi : v){ cout << __macro_vi << " ";} cout << endl;
#define DA(a, n) for (int __macro_i = 0; __macro_i < n; ++__macro_i) { cout << a[__macro_i] << " "; } cout << endl;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define ALL(v) (v).begin(), (v).end()
#include<iostream>
#include<vector>
#include<cassert>
#include<cmath>
#include<algorithm>

using namespace std;
int t[3];
int n;
int main()
{
    cin >> n;
    for(int i = 0; i < n; ++i) {
        for(int k = 0; k < 3; ++k) {
            cin >> t[k];
        }
        sort(t, t + 3);
        cout << ((t[2] * t[2] == t[0] * t[0] + t[1] * t[1]) ? "YES" : "NO") << endl;
    }
}

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

int main(void) {
    int a, b, c;
    
    while(cin >> a >> b >> c) {
        if(a*a + b*b == c*c) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
}

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

C++: #include<iostream>
int main(){int t,x,y,z;for(std::cin>>t;t--;printf(x+y-z&&y+z-x&&z+x-y?"NO\n":"YES\n"))std::cin>>x>>y>>z,x*=x,y*=y,z*=z;}

C++: #include <stdio.h>

void right_triangle(int a, int b, int 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");
    }
}

int main(void)
{
    int n, a, b, c;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        scanf("%d %d %d", &a, &b, &c);
        right_triangle(a, b, c);
    }    
    return 0;
}

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

using namespace std;

int main() {
	int caso;
	int lado_1, lado_2, lado_3;
	
	vector<int> triangle;
	
	cin >> caso;
	
	for(int index = 0; index < caso; ++index) {
		
		triangle.clear();
		
		cin >> lado_1 >> lado_2 >> lado_3;
		triangle.push_back(lado_1);
		triangle.push_back(lado_2);
		triangle.push_back(lado_3);
	
		sort(triangle.begin(), triangle.end());
		
		if( pow(triangle[0], 2) + pow(triangle[1], 2) == pow(triangle[2], 2) )
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	
	return 0;
}

C++: #include <stdio.h>

int main(){

	int N = 0, a, b, c,i;

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

C++: #include<iostream>
using namespace std;
int main(){
  int a[10000],b[10000],c[10000],n;
  cin>>n;
  for(int i=0;i<n;i++){
  cin>>a[i]>>b[i]>>c[i];
  a[i]*=a[i];
  b[i]*=b[i];
  c[i]*=c[i];
  }
  for(int i=0;i<n;i++){
  if(a[i]+b[i]==c[i]||a[i]+c[i]==b[i]||b[i]+c[i]==a[i]){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
  }
  return(0);
}