Go: package main

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

func sliceAtof64(sa []string) ([]float64, error) {
	si := make([]float64, 0, len(sa))
	for _, a := range sa {
		i, err := strconv.ParseFloat(a, 64)
		if err != nil {
			return si, err
		}
		si = append(si, i)
	}
	return si, nil
}

func answer(ans bool) {
	if ans {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
func isRightTriangle(ary []float64) (ans bool) {
	sort.Sort(sort.Reverse(sort.Float64Slice(ary)))
	ans = math.Pow(ary[1], 2.0)+math.Pow(ary[2], 2.0) == math.Pow(ary[0], 2.0)

	return
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	lineCount, _ := strconv.Atoi(scanner.Text())
	lines := make([]string, lineCount)

	for i := 0; i < lineCount; i++ {
		scanner.Scan()
		lines[i] = scanner.Text()
	}

	for _, v := range lines {
		ary, _ := sliceAtof64(strings.Split(v, " "))
		answer(isRightTriangle(ary))
	}
}

C++: #include<stdio.h>

int triangle(int a, int b, int c)
{
	if((a+b>c) && (a+c>b) && (b+c>a))
	    return 1;
	else
		return 0;
}

int main()
{
	int a, b, c, i, n;
	scanf("%d", &n);
	int m[n];
	for(i = 0; i < n; i++)
	{
		scanf("%d %d %d", &a, &b, &c);
		*(m+i) = triangle(a, b, c);
	}	

	if(m[0]==0)
			printf("No");
		else
			printf("Yes");
	for(i = 1; i < n; i++)
	{
		if(m[i]==0)
			printf("\nNo");
		else
			printf("\nYes");
	}
	return 0; 
}

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

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

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
 
#define MAX 1000
#define MIN 1
 
using namespace std;
 
bool right(int a,int b,int c) {
 if(((a * a) + (b * b)) == (c * c)) {
  return true;
 } else {
  return false;
 }
}

int main() {
 int i = 0,j;
 int n;
 int side[3];
 bool cnt = false;
 vector<string> judge;
 
 cin >> n;
 
 while(i < n) {
  cin >> side[0] >> side[1] >> side[2];
 
  for(j = 0;j < 3;++j) {
   if((side[j] < MIN) || (side[j] > MAX)) {
    cnt = true;
   }
  }
 
  if(cnt == true) continue; 
 
  sort(side, side + 3);
 
  if((right(side[0],side[1],side[2]) == true) {
   judge.push_back("YES");
  } else {
   judge.push_back("NO");
  }

  ++i;
 }
 
 for(i = 0;i < judge.size();++i) {
  cout << judge.at(i) << endl;
 }
 
 return 0;
}

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

int main()
{
 int n[3],t;
 scanf("%d", &t);
 while(t!=0){
  scanf("%d %d %d", &n[0],&n[1], &n[2]);
  sort(n,n+3);

  if((n[0]*n[0] + n[1]*n[1]) == n[2]*n[2]) printf("YES\n");
  else printf("NO\n");
  t--;
 }
return 0;

}

C++: #pragma GCC optimize "O3"
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <cassert>
#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define REP_FROM(i,m,n) for (int i = (m); (i) < int(n); ++(i))
#define REP_REV(i,n) for (int i = (n)-1; (i) >= 0; --(i))
#define REP_FROMREV(i,m,n) for (int i = (n)-1; (i) >= int(m); --(i))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#ifndef LOCAL
#define cerr if (false) cerr
#endif
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

template <class T> inline void setmax(T & a, T const & b) { a = max(a, b); }
template <class T> inline void setmin(T & a, T const & b) { a = min(a, b); }
template <class T> T sq(T x) { return x * x; }
template <class T> T clamp(T a, T l, T r) { return min(max(a, l), r); } // [l, r]
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int isRightTriangle(int a, int b, int c) {
	if(a > b && a > c)
		return b*b+c*c == a*a;
	else if(b > a && b > c)
		return a*a+c*c == b*b;
	else
		return a*a+b*b == c*c;
}

int main(int argc, char *argv[]) {
	// Something to do
	int n;
	cin >> n;
	REP(i, n) {
		int a, b, c;
		cin >> a >> b >> c;
		if(isRightTriangle(a,b,c))
			cout << "YES" << endl;
		else
			cout << "NO"  << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

int N;
int a, b, c;

int main() {
	cin >> N;

	for (int i = 0; i < N; i++) {
		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;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/

C++: #include <iostream>

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

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

    std::cin >> n;
    while (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 <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define MOD 1000000007 //10^9+7
#define INF 1000000000 //10^9

int main ()
{
    int n;
    vector<int> l;
    cin>>n;
    
    for (int i=0; i<n; i++) {
        for (int i=0; i<3; i++) {
            int d;cin>>d;
            l.push_back(d);
        }
        sort(l.begin(), l.end());
        if (l[0]*l[0]+l[1]*l[1]==l[2]*l[2]) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}

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

int main() {
    int l[3];
    int N;
    cin >> N;
    for(int i=0; i<N; ++i) {
        cin >> l[0] >> l[1] >> l[2];
        sort(begin(l), end(l));
        cout << (l[0]*l[0] + l[1]*l[1] == l[2]*l[2] ? "YES" : "NO") << endl;
    }
}