Go: package main

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

func main() {
	n, _ := strconv.Atoi(strScan())
	scanner := bufio.NewScanner(os.Stdin)
	for i := 0; i < n; i++ {
		scanner.Scan()
		strArr := strings.Fields(scanner.Text())
		castNumArr := StringToInt(strArr)
		fmt.Println(checkTriangle(castNumArr))
	}
}

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

func StringToInt(s []string) []int {
	var i []int
	for _, v := range s {
		castNum, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		i = append(i, castNum)
	}
	return i
}

func strScan() (stringInput string) {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	stringInput = scanner.Text()
	return
}

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

int main() {
	int n, a, b, c, t;
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a >> b >> c;
		if(a < b){
			t = a;
			a = b;
			b = t;
		}
		if(b < c){
			t = b;
			b = c;
			c = t;
		}
		if(a < c){
			t = a;
		    a = c;
		    c = t;
		}
		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,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+c*c==a*a||c*c+a*a==b*b){
cout<<"YES";} else{cout<<"NO";}}}

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

int main() {
	int iCase = 0;
	int a,b,c = 0;
	cin >> iCase;
	priority_queue<int,vector<int>,less<int> > que;

	while(iCase-- > 0 && cin >> a >> b >> c) {
		    
		que.push(a);
		que.push(b);
		que.push(c);

		int s1 = que.top(); que.pop();
		int s2 = que.top(); que.pop();
		int s3 = que.top(); que.pop();

		if (s3*s3 + s2*s2 == s1*s1)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	int N;
	cin >> N;

	int a, b, c;
	while (N--)
	{
		cin >> a >> b >> c;

		if (a*a + b*b == c*c || b*b + c*c == a*a || a*a + c*c == b*b)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

C++: #include <iostream>

bool judgement(int a, int b, int c)
{
	if (a*a == b*b + c*c) {
		return true;
	} else {
		return false;
	}
}

int main()
{
    int x;
	int y;
    int z;
	bool flag[3];
	while (true) {
	    std::cin >> x >> y >> z;
	    flag[0] = judgement(x, y, z);
	    flag[1] = judgement(y, z, x);
	    flag[2] = judgement(z, x, y);
	    if (flag[0] || flag[1] || flag[2]) {
	    	std::cout << "YES" << std::endl;
	    	} else {
	    		std::cout << "NO" << std::endl;
	    		}
	   }
}

C++: #include<iostream>

int main(){
  int a,b,c;
  std::cin>>a;
  std::cin>>b;
  std::cin>>c;
  if (a*a==b*b+c*c) std::cout<<"YES";
  else if (b*b==a*a+c*c) std::cout<<"YES";
  else if (c*c==a*a+b*b) std::cout<<"YES";
  else std::cout<<"NO";
  std::cout<<std::endl;

	
	return 0;
}

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

class Triangle{
public:
Triangle(){
}
void push(int num1,int num2,int num3){
if(num1>=num2){
if(num1>=num3){c=num1;a=num2;b=num3;}
else{c=num3;a=num1;b=num2;}
}
else{
if(num2>=num3){c=num2;a=num1;b=num3;}
else{c=num3;a=num1;b=num2;}
}
};
void checkRight(){
int cs=c*c;
if(cs==a*a+b*b) ans=1;
else ans=0;
};

void print(){
if(ans==0)
cout << "NO" << endl;
if(ans==1)
cout << "YES" << endl;
}

protected:
int a,b,c,ans;
};

C++: #include<iostream>
#include<algorithm>
#include<vector>

using namespace std;
int main()
{
	int n;
	cin >> n;
	
	
	for(int i=0;i<n;i++){
		int a[3];
		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>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	int T;
	cin >> T;
	while(T--){
		vector<int> v(3);
		cin >> v[0] >> v[1] >> v[2];
		sort(v.begin(),v.end());
		if( v[0]*v[0]+v[1]*v[1]==v[2]*v[2])
				cout << "YES" << endl;
		else cout << "NO" << endl;
		
	}
}

C++: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {

	/**
	 * <p>
	 * 与えられた三辺で直角三角形が作れるかを判定する。
	 * </p>
	 *
	 * @param args
	 *            利用しない。
	 * @throws IOException
	 */
	public static void main(String[] args) throws NumberFormatException,
			IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int lineCount = Integer.parseInt(br.readLine());
		for (int i = 0; i < lineCount; i++) {

			String line = br.readLine();

			// 三辺の長さをリストに格納し、ソート
			List<Integer> sideList = new ArrayList<Integer>();
			String[] input = line.split(" ");
			sideList.add(Integer.parseInt(input[0]));
			sideList.add(Integer.parseInt(input[1]));
			sideList.add(Integer.parseInt(input[2]));
			Collections.sort(sideList);

			if (isRightTriangle(sideList.get(2), sideList.get(1),
					sideList.get(0))) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}

	/**
	 * 三辺の長さから、直角三角形であるかどうかを判定する。<br>
	 * 注意：第一引数に最も長い辺を与えること。
	 *
	 * @param side1
	 *            辺1
	 * @param side2
	 *            辺2
	 * @param side3
	 *            辺3
	 * @return 直角三角形であるかどうか
	 */
	private static boolean isRightTriangle(int side1, int side2, int side3) {
		return (side1 * side1 == side2 * side2 + side3 * side3);
	}
}

C++: #include<iostream>
using namespace std;
int main(){
  int n,a,b,c;
  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) || (c*c)+(b*b)==(a*a)) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}

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

int main()
{
    int i;
    int a[3];
    cin >> i;
    for (int n = 0; n < i; n++) {
        for (int j = 0; j < 3; j++)
            cin >> a[j];
        sort(a, a + 3);
        if (a[2] * a[2] == a[0] * a[0] + a[1] * a[1])
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
	int n;
	vector<int> a(3);
	cin >> n;
	for(int i=0;i<n;i++){
		cin>>a[0]>>a[1]>>a[2];
		sort(a.begin(),a.end());
		if(a[2]*a[2]==a[0]*a[0] + a[1]*a[1]){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
}

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

using namespace std;

int main()
{
	int n;
	cin >> n;

	int a[3];
	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;
			continue;
		}
		cout << "NO" << endl;
	}
    return 0;
}

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

int main(){
	vector<vector<int> > a;

	int lines = 0;
	scanf("%d", &lines);

	bool isOk[lines];
	for (int i = 0; i < lines; ++i)
	{
		int l[3];
		for (int j = 0; j < 3; ++j)
			scanf("%d", &l[j]);

		if(pow(l[0], 2.0) + pow(l[1], 2.0) == pow(l[2], 2.0)) isOk[i] = true;
		if(!isOk[i] && pow(l[1], 2.0) + pow(l[2], 2.0) == pow(l[0], 2.0)) isOk[i] = true;
		if(!isOk[i] && pow(l[2], 2.0) + pow(l[0], 2.0) == pow(l[1], 2.0)) isOk[i] = true;
	}

	for (int i = 0; i < lines; ++i)
	{
		if(isOk[i]) printf("YES\n");
		else printf("NO\n");
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
int n;
long long int a, b, c, s;
 int main()
 {
     cin >> n;
     while(n--)
     {
         cin >> a >> b >> c;
         a = a*a;
         b = b*b;
         c = c*c;
         if (a == b + c || c  == b + a || b == a + c)
            cout << "YES" << endl;
         else
            cout << "NO" << endl;
     }
     return 0;
 }