Go: package main

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

var (
	sc = bufio.NewScanner(os.Stdin)
)

func main() {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	for i := 0; i < n; i++ {
		sc.Scan()
		edges := make([]int, 3, 3)
		for i, c := range strings.Split(sc.Text(), " ") {
			edges[i], _ = strconv.Atoi(c)
			edges[i] = int(math.Pow(float64(edges[i]), 2))
		}
		sort.IntSlice(edges).Sort()
		msg := "NO"
		if edges[2] == edges[0]+edges[1] {
			msg = "YES"
		}
		fmt.Println(msg)
	}
}

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\n";
        }
        else {
            cout << "NO\n";
        }
    }

    return 0;
}

C++: //
//  main.cpp
//  b
//
//  Created by h3037178 on 2017/07/31.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main(){
    int a,b,c,i;
    cin >> i;
    for(int n = 0;n < i;n++){
        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;} 
    }
}

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

int main() {
    int N;
    cin >> N;
    int a, b, c;
    while (N--) {
        cin >> a >> b >> c;
        int l=max(a,max(b,c));
        int x=0, y=0;
        if (a==l) {
            x=b;
            y=c;
        } else if (b==l) {
            x=a;
            y=c;
        } else if (c==l) {
            x=a;
            y=b;
        }
        if (l==sqrt(pow(x,2)+pow(y,2))) {
            printf("Yes\n");
        } else {
            printf("No\n");
        }
    }
    return 0;
}

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

int main()
{
	int N;
	cin >> N;
	int A[3];
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			cin >> A[j];
		}
		sort(A, A + 3);
		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 a,b,c,n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>b>>c;
		if(a*a==b*b+c*c or b*b==a*a+c*c or c*c==a*a+b*b){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"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,b,c;
		cin>>a>>b>>c;
		if(a*a+b*b==c*c){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}	
}

C++: #include <sstream>
#include <iostream>
#include <string>
#include <algorithm>
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

using namespace std;

int main(){
	int n;
	cin >> n;
	int e[3];
	REP(i,n){
		REP(j,3)cin>>e[j];
		sort(e, e+3);
		if(e[0]*e[0]+e[1]*e[1]==e[2]*e[2])cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

C++: #include <iostream>

inline bool is_right_triangle(const u_int a, const u_int b, const u_int c) {
    return (a*a == b*b + c*c || b*b == c*c + a*a || c*c == a*a + b*b);
}

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

    std::cin >> n;
    for (u_int i = 0; i < n; ++i) {
        std::cin >> a >> b >> c;
        std::cout << (is_right_triangle(a, b, c) ? "YES\n" : "NO\n");
    }

    return 0;
}

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