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

static const int DataMax = 1000;	// 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 <algorithm>
using namespace std;

int main()
{
	int nNum=0;
	cin>>nNum;
	int nIn[3]={0};
	while(nNum--)
	{
		cin>>nIn[0]>>nIn[1]>>nIn[2];
		int nMax=max(max(nIn[0],nIn[1]),nIn[2]);
		if(nMax*2*nMax==nIn[0]*nIn[0]+nIn[1]*nIn[2]+nIn[2]*nIn[2])
		{
			cout<<"YES"<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}