Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	li := make([]int, 3)

	sc.Scan()
	N, _ := strconv.Atoi(sc.Text())

	for i := 0; i < N; i++ {
		for j := 0; j < 3; j++ {
			sc.Scan()
			x, _ := strconv.Atoi(sc.Text())
			li[j] = x
		}
		sort.Ints(li)

		switch li[2]*li[2] == li[1]*li[1]+li[0]*li[0] {
		case true:
			fmt.Println("YES")
		case false:
			fmt.Println("NO")
		default:
		}
	}

}

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

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    vector<int> array;
    int a;
    cin >> a;
    array.push_back(a);
    cin >> a;
    array.push_back(a);
    cin >> a;
    array.push_back(a);
    sort(array.begin(), array.end(), greater<int>());
    cout << (array[0] * array[0] == array[1] * array[1] + array[2] * array[2] ? "YES" : "NO") << endl;
  }
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;cin >> n;
	for(int i = 0; i < n; i++){
		int l[3] = {};
		for(int j = 0; j < 3; j++){
			cin >> l[j];
		}
		bool flag = false;
		for(int j = 0; j < 3; j++){
			//printf("%d %d %d",l[j]*l[j],l[(j+1)%3]*l[(j+1)%3],l[(j+2)%3]*l[(j+2)%3]);
			if(l[j]*l[j] + l[(j+1)%3]*l[(j+1)%3] == l[(j+2)%3]*l[(j+2)%3]){
				flag = true;
				break;
			}
		}
		cout << (flag?"YES":"NO") << endl;
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
 
int main() {
    int n;
    cin >> n;
    for (int i=0;i<n;++i){
        int a;
        int b;
        int 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<bits/stdc++.h>
using namespace std;
int main(){
  int n,a,b,c;
  cin>>n;
  int d[n];
  for(int i=0;i<n;i++){
    cin>>a>>b>>c;
    if(a*a==(b*b+c*c)){
      d[i]=1;
    }
    else if(b*b==(a*a+c*c)){
      d[i]=1;
    }
    else if(c*c==(a*a+b*b)){
      d[i]=1;
    }
    else{
      d[i]=0;
    }
  }
  for(int i=0;i<n;i++){
    if(d[i]==1){
      cout<<"YES"<<endl;
    }
    else{
      cout<<"NO"<<endl;
    }
  }
}

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

using namespace std;

//input
int a[3];

void solve(){
	sort(a, a + 3);
	if(a[0] * a[0] + a[1] * a[1] == a[2] * a[2])
		printf("YES\n");
	else
		printf("NO\n");
}

int main(int argc, char const *argv[]){
//	freopen("in.txt", "r", stdin);

	int t;
	scanf("%d", &t);
	while(t --){
		for(int i = 0; i < 3; i ++)
			scanf("%d", &a[i]);
		solve();
	}

	return 0;
}

C++: #include <stdio.h>
#include <stdbool.h> 

bool judge(int x, int y, int z)
{    
    static bool flag = false;
    if (x * x + y * y == z * z){
        flag = true;
    } else if (y * y + z * z == x * x){
        flag = true;
    } else if (z * z + x * x == y * y){
        flag = true;
    }
    return flag;
}


int main(void)
{
    int repeat, a, b, c;
    scanf("%d", &repeat);
    for (int i = 0; i < repeat ; ++i){
        scanf("%d %d %d", &a, &b, &c); 
        bool flag = judge (a, b, c); 
        if (flag == true){    
            printf("YES\n");
        }else{	
            printf("NO\n");
        }
    }
    return 0;        
}

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

using namespace std;

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

    cin >> n;

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

        if(a == double(sqrt(pow(b,2) + pow(c,2)))){
            cout << "Yes" << endl;
        }

        else if(b == double(sqrt(pow(a,2) + pow(c,2)))){
            cout << "Yes" << endl;
        }

        else if(c == double(sqrt(pow(a,2) + pow(b,2)))){
            cout << "Yes" << endl;
        }

        else{
            cout << "No" << endl;
        }
    }

    return 0;
}

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

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

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

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

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

int main() {
  int ct = 0;
  vector<int> v(3);
  queue<bool> q;

  scanf("%d", &ct);
  for(int i = 0; i < ct; i++) {
    scanf("%d %d %d", &v[0], &v[1], &v[2]);
    sort(v.begin(), v.end());
    q.push(v[2] * v[2] == v[0] * v[0] + v[1] * v[1] ? true : false);
    v.clear();
  }
  for(int i = 0; i < ct; i++) {
    printf("%s\n", q.front() == true ? "YES" : "NO");
    q.pop();
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define REP(a) while(a--)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int n;
	cin>>n;
	REP(n){
		vi in(3);
		rep(i,3)cin>>in[i];
		sort(all(in));
		if(in[0]*in[0]+in[1]*in[1]==in[2]*in[2])cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}

}

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

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,a,b,c;
    std::deque<int> deq;
    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" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    
    
}

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

using namespace std;

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

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

//??´?§?????§???¢?????????????????????????????¢??°
int triangle(int a, int b, int c){
  if(a*a == b*b + c*c || b*b == c*c + a*a || c*c == a*a + b*b){
    return 1; //??´?§?????§???¢??§????????¨???
  }
  else
    return 0; //??´?§?????§???¢??§????????¨???
}

int main(){
  int a, b, c; //3???????????°
  int n; //???????????????????????°
  
  //std::cout << "Input the number of dataset\n";
  std::cin >> n;

  int ans[n];
  for(int i=0; i<n; i++){
    std::cin >> a >> b >> c;
    ans[i] = triangle(a, b, c);
  }

  for(int i=0; i<n; i++){
    if(ans[i] == 1)
      std::cout << "YES\n";
    else if(ans[i] == 0)
      std::cout << "NO\n";
  }
  
  return 0;
  
}

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


int main(){
	int i;
	deque<int> nums;

	cin >> i;

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

		nums.push_front(a);
		nums.push_front(b);
		nums.push_front(c);

		sort(nums.begin(), nums.end());

		a = nums[0];
		b = nums[1];
		c = nums[2];

		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 N;
int a[3]; 
int b,c,d;

int main() {
  for (int i = 0; i < N; ++i) {
    cin >> a[1] >> a[2] >> a[3];
    sort(a,a+3);
    b = a[1]*a[1];
    c = a[2]*a[2];
    d = a[3]*a[3];
    if ( d + c == b ) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  
}