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>
#include <vector>
#include <functional>
#include <cmath>
#include <algorithm>
using namespace std;

int main() {

    int N;
    cin >> N;

    int a, b, c;

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

        vector<int> vec;

        vec.push_back(a);
        vec.push_back(b);
        vec.push_back(c);

        sort(vec.begin(), vec.end(), greater<int>());

        if(pow(vec[0], 2) == pow(vec[1], 2) + pow(vec[2], 2)) {
            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))
      cout<<"YES"<<endl;
    else if((b*b)==(a*a)+(c*c))
      cout<<"YES"<<endl;
    else if((c*c)==(a*a)+(b*b))
      cout<<"YES"<<endl;
    else
      cout<<"NO"<<endl;
  }
  return 0;
}

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

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||a*a+c*c==b*b||b*b+c*c==a*a)
			cout<<"YES"<<endl;
		else  
			cout<<"NO"<<endl;
	}
	return 0;	
}

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

int main(){
	int N = 0;
	int array[3] = {};
	int i, j, k;
	int work;
	cin >> N;
	for(i = 0; i <= N; i++){
		cin >> array[0] >> array[1] >> array[2];


		for (j = 0; j < 3 - 1; j++) {
			for (k = 3 - 1; k > j; k--) {
				if (array[k - 1] > array[k]) {
					work = array[k];
					array[k] = array[k - 1];
					array[k - 1]= work;
				}
			}
		}	
			
		if( (array[0] + array[1]) < array[2] ){
				cout << "YES\n";
				
		}
		
		else{
			cout << "NO\n";
		}
    }
    return 0;
}

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

int main()
{
	int side1[1000], side2[1000], side3[1000], N;
	cin >> N;
	for (int i = 0; i < N; ++i) {
		cin >> side1[i] >> side2[i] >> side3[i];
	}
	for (int i = 0; i < N; ++i) {
		int a = side1[i] * side1[i], b = side2[i] * side2[i], c = side3[i] * side3[i];
		if (a + b == c || a + c == b || b + c == a)cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
int main(){
	int N;
	int count=0;
	int a[3];
	scanf("%d ",&N);
	while(count!=N){
	for(int i=0;i<3;i++){
		scanf("%d ",a[i]);
	}
	sort(a,a+3);
	if(a[2]<(a[0]+a[1])){
		printf("YES");
		count++;
	}
	else{
		printf("NO");
		count++;
	}
	}
	return 0;
	}

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

int main(){
	int n;
	cin>>n;
	int a, b, c;
	while(cin>>a>>b>>c){
		int ansflg = false;
		if(a*a==b*b+c*c) ansflg = true;
		if(b*b==a*a+c*c) ansflg = true;
		if(c*c==b*b+a*a) ansflg = true;
		if(ansflg)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include<cstdio>
int main(){
	int n;
	int a,b,c;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d %d %d",&a,&b,&c);
		int max;
		char max_c;
		if(a>b) {max_c = 'a';}
		else {max_c = 'b';}
		if(c > max) {max_c = 'c';}
		
		if(max_c == 'a'){
			if(a*a == b*b + c*c) printf("YES\n");
			else printf("NO\n");
		}
		else if(max_c == 'b'){
			if(b*b == c*c + a*a) printf("YES\n");
			else printf("NO\n");
		}
		else{
			if(c*c == a*a + b*b) printf("YES\n");
			else printf("NO\n");
		}
	}
	return 0;
}

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

C++: #include<stdio.h>
#include<iostream>
#include<cmath>
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 || b*b == a*a + c*c || c*c == a*a + b*b) {
			printf("YES\n");
		}else printf("NO\n");
	}

	return 0;

C++: #include <bits/stdc++.h>
using namespace std;

int main(void){
    int n;
    cin >> n;
    while(n--){
        int a[3];
        cin >> a[0] >> a[1] >> a[2];
        bool tf=false;
        for(int b=0; b<3; b++){
            for(int c=0; c<3; c++){
                if(b==c) continue;
                for(int d=0; d<3; d++){
                    if(b==d || c==d) continue;
                    if((a[b]*a[b]+a[c]*a[c])==a[d]*a[d]) tf=true;
                }
            }
        }
        cout << (tf? "YES":"NO") << "\n";
    }
}

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

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

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

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

C++: #include<bits/stdc++.h>
using namespace std;


long long a,b,c,n;

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

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

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
    int T;
    cin >> T;
    while(T--){
        int a,b,c;
        cin >> a >> b >> c;
        if( a > b ) swap(a, b);
        if( b > c ) swap(b, c);
        if( a > b ) swap(a, b);
        if( a * a + b * b == c * c ){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}

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

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