Go: package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	n := nextInt()
	for i := 0; i < n; i++ {
		data := nextInts(3)
		fmt.Fprintln(out, checkTriangle(data))
	}
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}
	return a
}

func checkTriangle(i []int) string {
	if checkSt(i[0], i[1], i[2]) || checkSt(i[1], i[2], i[0]) || checkSt(i[2], i[0], i[1]) {
		return "YES"
	}
	return "NO"
}
func Sq(x int) int {
	return x * x
}

func checkSt(a, b, c int) bool {
	return (Sq(a) + Sq(b)) == Sq(c)
}

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

int main(void){
	int x[3];
	cin >> x[1];
	string n = "NO", y = "YES";
	while(cin >> x[0] >> x[1] >> x[2]){
		sort(x,x + 3);
		if(x[2] * x[2] == x[1] * x[1] + x[0] * x[0])
			cout << y << endl;
		else
			cout << n << endl;
	}
	return 0;
}

C++: #include <stdio.h>
int main(void){
   int i,N,a,b,c;
   scanf("%d",&N);
   for(i=1;i<=N;i++){
       scanf("%d %d %d",&a,&b,&c);
   if ((a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a)
     && (a > 0 && b > 0 && c > 0)) {
       printf("YES\n");
   }
 else {
   printf("NO\n");
 }  
     }
   return 0;   
}

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

int main() {
	int data_sets_num = 0;		//??\???????????????????????????????????°
	std::vector<string> result;
	
	cin >> data_sets_num;
	for (int i = 0; i < data_sets_num; i++) {
		int first, second, third;

		cin >> first >> second >> third;
		if (
			(first * first == second * second + third * third) ||
			(second * second == first * first + third * third) ||
			(third * third == second * second + first * first)
			) {
			result.push_back("YES");
		}
		else {
			result.push_back("NO");
		}
	}

	for (unsigned int j = 0; j < result.size(); j++) {
		cout << result[j] << endl;
	}

	return 0;
}

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

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

C++: 
#include <iostream>

using namespace std;

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

int main() {
    int n;
    cin >> n;
    while(n--) {
        int a, b, c;
        cin >> a >> b >> c;
        if(right(a,b,c) || right(a,c,b) || right(b,c,a)) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

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

void swap(int& a, int& b) {
	int x = a;
	a = b;
	b = x;
}

void mySort(int& a, int& b, int& c) {
	int min = 0;
	int mid = 0;
	int max = 0;

	max = a;
	mid = b;
	if(mid >= max)	swap(mid, max);
	min = c;
	if(min >= mid)	swap(min, mid);
	if(mid >= max)	swap(mid, max);
	a = min;
	b = mid;
	c = max;
}

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

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, y;
        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 i, m;
	cin >> m;

	for(i=0; i<m; i++){

	int a[3];

	cin >> a[0] >> a[1] >> a[2];
	sort(a, a+3);

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

C++: #include<iostream>
#include<string>
//0001
#include<cstddef>
#include<queue>
#include<vector>
using namespace std;

int main() {
	//0000
	/*
	int i, j;

	for (i = 1; i < 10; i++) {
		for (j = 1; j < 10; j++) {
			cout << i << "x" << j << "=" << i*j << endl;
		}
	}
	*/
	//0001
	/*
	int i;
	const size_t MNum = 10;
	int MHeight[MNum];
	int MH1 = 0, MH2 = 0, MH3 = 0;
	for (i = 0; i < 10; i++) {
		cin >> MHeight[i];
		if (MHeight[i] > MH1) {
			MH3 = MH2;
			MH2 = MH1;
			MH1 = MHeight[i];
		}
		else if (MHeight[i] > MH2) {
			MH3 = MH2;
			MH2 = MHeight[i];
		}
		else if (MHeight[i] > MH3) {
			MH3 = MHeight[i];
		}
	}
	cout << MH1 << endl << MH2 << endl << MH3 << endl;
	*/
	/*
	priority_queue<int, vector<int>, less<int> > que;
	int MH;

	for (int i = 0; i < 10; i++) {
		cin >> MH;
		que.push(MH);
	}

	for (int j = 0; j < 3; j++) {
		cout << que.top() << endl;
		que.pop();
	}
	*/
	//0002
	/*
	int a, b;
	while (cin >> a >> b) {
		int sum = a + b;
		int count = 0;
		while (sum > 0) {
			sum = sum / 10;
			count++;
		}
		cout << count << endl;
	}
	*/
	//0003
	int a[3];
	int N;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> a[0] >> a[1] >> a[2];
		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>
 
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;
    std::cin >> n;
    
    for (u_int i = 0; i < n; ++i) {
        u_int a, b, c;
        std::cin >> a >> b >> c;
        std::cout << (is_right_triangle(a, b, c) ? "YES" : "NO") << std::endl;
    }
 
    return 0;
}

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

int N;
int a[3]; 
int b,c,d;

int main() {
  for (int i = 0; i < N; ++i) {
    cin >> a[0] >> a[1] >> a[2];
    sort(a,a+3);
    b = a[0]*a[0];
    c = a[1]*a[1];
    d = a[2]*a[2];
    if ( b + c == d ) {
    cout << "YES" << endl;
    } else {
    cout << "NO" << endl;
    }
  }
  
}

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

//exchange x for y
void swap(int& x, int& y){
    int t = x;
    x = y;
    y = t;
}

//judge if this data set is right triangle
bool judgeRightTriangle(int& a, int& b, int& c){
    //arrange in ascending order
    if(a > b) swap(a, b);
    if(b > c) swap(b, c);
    //judge
    if(pow(c, 2) == pow(a, 2) + pow(b, 2)){
        return true;
    } else{
        return false;
    }
}

int main(){
    //入力
    int num = 0;
    cin >> num;

    //判定
    int a, b, c;
    bool check[num];
    for(int i = 0;i < num;i++){
        cin >> a >> b >> c;
        check[i] = judgeRightTriangle(a, b, c);
    }
    //出力
    for(int i = 0;i < num;i++){
        if(check[i] == true){
            cout << "YES\n";
        } else{
            cout << "NO\n";
        }
    }
    return 0;
}