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 <iostream>
#include <vector>
#include <math.h>

static const int DataMax = 200;	// Max value of elements

typedef struct _triangle
{
    int count;	// Number of elements
    std::vector<int> vec[DataMax];
} triangle_t;

static void inputData(triangle_t& data, int& num)
{
    int v1, v2, v3;

    if (0x00 == &data) {
        std::cerr << "data is null" << std::endl;
        return;
    }

    std::cin >> num;
    for (int i = 0; i < num; i++) {
        std::cin >> v1 >> v2 >> v3;
        data.vec[data.count].push_back(v1);
        data.vec[data.count].push_back(v2);
	data.vec[data.count].push_back(v3);
        data.count++;
    }
}

static bool isRightTriangle(std::vector<int>& vec)
{
    if (0x00 == &vec) {
        std::cerr << "vec is null" << std::endl;
        return false;
    }

    if ((int)pow((double)vec.at(0), 2.0) + (int)pow((double)vec.at(1), 2.0) == (int)pow((double)vec.at(2), 2.0)) {
        return true;
    }

    return false;
}

int main()
{
    triangle_t triangle = {0};
    int num = 0;

    inputData(triangle, num);
    for (int i = 0; i < num; i++) {
        if (true == isRightTriangle(triangle.vec[i])) {
            std::cout << "YES" << std::endl;
        } else {
            std::cout << "NO" << std::endl;
        }
    }

    return 0;
}

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


int main(){

  int n;
  cin >> n;

  vector <int> array(n,0);

  for(int i = 0; i < n;i++){
    cin >> array[0] >> array[1] >> array[2];
    sort(array.begin(),array.end());

    if(pow(array[0],2) + pow(array[1],2) == pow(array[2],2)){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }


  return 0;
}

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

int main() {
    std::array<long long int, 3> arr;;
    int n;
    
    std::cin >> n;

    while (n--) {
        std::cin >> arr[0] >> arr[1] >> arr[2];
        std::sort(arr.begin(), arr.end());
        std::cout << (std::pow(arr[0], 2) + std::pow(arr[1], 2)
                      == std::pow(arr[2], 2) ? "YES" : "NO")
                  << std::endl;
    }

    return 0;
}

C++: #include<stdio.h>
#include<math.h>
int main(void)
{
	int k[100][3],ct;
	int mem;
	scanf("%d",&ct);
	for(int f1=0;f1<ct;f1++){
		scanf("%d %d %d",&k[f1][0],&k[f1][1],&k[f1][2]);
	}
	for(int f=0;f<ct;f++){
		for(int f1=0;f1<3;f1++){
			for(int f2=0;f2<3;f2++){
				if(k[f][f1]>k[f][f2]){
					mem=k[f][f1];
					k[f][f1]=k[f][f2];
					k[f][f2]=mem;
				}
			}
		}
	}
	for(int f1=0;f1<ct;f1++){
		if(pow((double)k[f1][0],2)==pow((double)k[f1][1],2)+pow((double)k[f1][2],2)){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int N,A[1000],a,b,c;
	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)
		{
			A[i] = 1;
		}
		else
		{
			A[i] = 0;
		}
	}
	for (int j = 0; j < N; j++)
	{
		if (A[j] == 1)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

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

using namespace std;

int main() {
    int i,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 <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define FOR(x,a,b) for(int x=a;x<b;x++)
#define REP(x,b) for(int x=0;x<b;x++)
#define FORSIZE(x,A) for(int x=0;x<A.size();x++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define SORT(x) sort(x.begin(),x.end())
#define RSORT(x) sort(x.rbegin(),x.rend())
#define rsort(x,n) sort(x, x+n, greater<int>())
#define REV(x) reverse(x.begin(),x.end())
using namespace std;
typedef long long ll;
inline int toInt(std::string s) {int v; std::istringstream sin(s);sin>>v;return v;}
template<class T> inline std::string toString(T x) {std::ostringstream sout;sout<<x;return sout.str();}

int main( int argc, const char* argv[] )
{
    int n;
    int a, b, c;
    cin >> n;
    REP(i, n) {
        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 a,b,c,n,index;
   
      index = 0; 
      cin >> n; 
      while(1)
      {
           cin >> a >> b >> c;       
           if( (a*a + b*b) == c*c)     
                   cout << "Yes" << endl;
           else
                   cout << "No" << endl;
        
          if(index == n)
                   break;     
   
          index++;
     }
   
     return 0;
}

C++: #include<stdio.h>

int main(void)
{
	int i;
	int x[999]={0},y[999]={0},z[999]={0},hantei[999]={0};
	int j=0,e =0;

	while(e==0)
	{
		scanf("%d %d %d",&x[j],&y[j],&z[j]);
		
		if(x[j]<1 || 1000<x[j] || y[j]<1 || 1000<y[j] || z[j]<1 || 1000<z[j])break;

		j=j+1;
	}

	for(i=0;i<j;i++)
	{
		if(y[i]<x[i] && z[i]<x[i])
		{
			if(x[i]*x[i] == y[i]*y[i]+z[i]*z[i])
				hantei[i]=1;
		}
		else if(x[i]<y[i] && z[i]<y[i])
		{
			if(y[i]*y[i] == x[i]*x[i]+z[i]*z[i])
				hantei[i]=1;
		}
		else
		{
			if(z[i]*z[i] == x[i]*x[i]+y[i]*y[i])
				hantei[i]=1;
		}
	   
	switch(hantei[i])
	    {
		   case 0:
			  printf("NO\n");
			  break;
		   case 1:
			  printf("YES\n");
		      break;
	   }
	}

	return 0;
}