Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	nQueries := nextInt()
	for i := 0; i < nQueries; i++ {
		lengths := []int{nextInt(), nextInt(), nextInt()}
		sort.Slice(lengths, func(i, j int) bool { return lengths[i] > lengths[j] })
		if math.Pow(float64(lengths[0]), 2) == math.Pow(float64(lengths[1]), 2)+math.Pow(float64(lengths[2]), 2) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <stdio.h>

void triangle(int number)
{
    for(int i = 0; i < number; ++i) {
        int a, b, c;
        scanf("%d %d %d", &a, &b, &c);
        if ((a > b) && (a > c)) {
            if (a * a == b * b + c * c) {
                printf("YES\n");
            } else {
                printf("NO\n");
            }
        } else if ((b > a) && (b > c)) {
            if (b * b == a * a + c * c) {
                printf("YES\n");
            } else {
                printf("NO\n");
            }
        } else if ((c > a) && (c > b)) {
            if (c * c == a * a + b * b) {
                printf("YES\n");
            } else {
                printf("NO\n");
            }
        } else //a == b == c
        {
            printf("NO\n");
        }
    }
}

int main(void)
{
    int number;
    scanf("%d", &number);
    triangle(number);
    return 0;
}

C++: #define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

int main(){
  int n,a,b,c;
  cin>>n;
  
  rep(i,n){
    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>
//#include <algorithm>

using namespace std;

void sort(int* arr);

int main()
{
    int num, h, l, r;
    int line[3];

    cin >> num;

    for (int n = 0; n < num; n++)
    {
        cin >> line[0] >> line[1] >> line[2];

//        cout << "input:" << line[0] << " " << line[1] << " " << line[2] << endl;

        h = 0;
        l = 0;
        r = 0;

        sort(line);
        h = line[0];
//        h = *max_element(line, line + num);
//        cout << "max:" << h << endl;

        for (int i = 0; i < 3; i++)
        {
            if (line[i] == h && l == 0)
            {
                l = line[i] * line[i];
            }
            else
            {
                r += line[i] * line[i];
            }
        }

//        cout << "left:" << l << endl;
//        cout << "right:" << r << endl;

        if (l == r)
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }

    return 0;
}

void sort(int* arr)
{
    for (int i = 0; i < 2; i++)
    {
        for (int n = 0; n < 2 - i; n++)
        {
            if (arr[n] < arr[n+1])
            {
                swap(arr[n], arr[n+1]);
            }
        }
    }
}

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

bool isRightTriangle(int a, int b, int c) {
    int newc = sqrt(a*a + b*b);
    int newb = sqrt(c*c - a*a);
    int newa = sqrt(c*c - b*b);
    return(a == newa && b == newb && c == newc);
}

int main(void) {
    int num; cin >> num;
    for(int r = 0; r < num; r++) {
        int a, b, c; cin >> a >> b >> c;
        cout << (isRightTriangle(a, b, c) ? "YES" : "NO") << endl;
    }
    return(0);
}

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

int main() {
	int a;
	scanf("%d", &a);
	vector<int>b(3);
	for (int c = 0; c < a; c++) {
		scanf("%d%d%d", &b[0], &b[1], &b[2]);
		sort(b.begin(), b.end());
		if (b[0] * b[0] + b[1] * b[1] == b[2] * b[2])printf("YES\n");
		else printf("NO\n");
	}
}

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

inline bool isTriangle(int edge[]){
    return edge[2]<edge[0]+edge[1]?true:false;
}

int main(void){
    int edge[3];
    int n;
    std::cin>>n;
    for(int i=0;i<n;i++){
        std::cin>>edge[0]>>edge[1]>>edge[2];
        std::sort(edge,edge+3);
        std::cout<<(isTriangle(edge)?"YES":"NO")<<std::endl;
    }
    return 0;
}

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

int main() {
    int n;
    int 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==c*c+a*a){
            cout << "Yes" << endl;
        }
        else if(c*c==a*a+b*b){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }
    return 0;
}

C++: #include <stdio.h>

#define MAX 1000000

int isPrime[MAX];

int main(){
    int num;
    int i, j;
    int count;
    
    // ??????????????????
    isPrime[0] = isPrime[1] = 0;
    for(i = 2; i < MAX; i++){
        isPrime[i] = 1;
    }
    
    // ??¨??????????????????????????????
    for(i = 2; i * i < MAX; i++){
        if(isPrime[i]){
            // i????????°????´???°?????????????????§????????°?????´
            for(j = 2 * i; j < MAX; j+=i){
                isPrime[j] = 0;
            }
        }
    }

    while(scanf("%d", &num) != EOF){
        count = 0;
        while(num){
            count += isPrime[num--];
        }
        printf("%d\n", count);
    }

    return 0;
}

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

bool isTriangle(int a, int b, int c);

int main(){
	int a, b, c, count;
	bool check;
	
	std::cin >> count;
	
	for(int i = 0; i < count; ++i){
		std::cin >> a >> b >> c;
		
		int max_num = std::max({a, b, c});
		if(max_num == a) check = isTriangle(b, c, a);
		else if(max_num == b) check = isTriangle(a, c, b);
		else if(max_num == c) check = isTriangle(a, b, c);
		
		if(check) std::cout << "YES" << std::endl;
		else std::cout << "NO" << std::endl;
	}
	
	return 0;
}

bool isTriangle(int a, int b, int c){
	if(std::pow(a, 2) + std::pow(b, 2) == std::pow(c, 2)) return true;
	else return false;
}

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

int main(){
    int total_num;
    cin >> total_num;
    int a,b,c;
    for (int i = 0; i< total_num;i++){
        cin >> a >> b >> c;
        int array[3] = {a,b,c};
        std::sort(array, array+3);
        if (pow(array[2], 2) == pow(array[0],2) + pow(array[1],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){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}	
}

C++: #include<stdio.h>
int main(void){
  int max,min,a,b,c,d,e,f,i,j;
int n[9999];
j=0;
scanf(" %d", &i);
while(j<i){
scanf(" %d %d %d",&a,&b,&c);
d=a+b;
e=a+c;
f=b+c;
if(a>b){
  if(a>c)
    max=a;
  else max=c;}
 else if(b>c)
   max=b;
     else max=c;
if(d<e){
  if(d<f)
    min=d;
  else min=f;}
 else if(e<f)
   min=e;
     else min=f;
 if(max<min)
   n[j]=1;
 else 
   n[j]=0;
 j++; 
}
for(j=0;j<i;j++){
  if(n[j])
    printf("YES\n");
  else 
    printf("NO\n");
 }
return 0;
}