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 <stdio.h>


int main()
{
    int n,a,b,c,sum=0,i;
    while(scanf("%d",&n)==1)
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&a,&b,&c);
        sum=sqrt((a*a)+(b*b));
        if(c==sum)
        {
            printf("YES\n");
        }
        else
        printf("NO\n");
    }

    return 0;
}

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

    return 0;
}

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

using namespace std;

int main(){
	int n;
	cin >> n;
	while(--n){
		int a, b, c, sum;
		cin >> a >> b >> c;
		int x, y ,z;
		x = max(a,max(b,c));
		y = min(a,min(b,c));
		z = sum - x - y;
		
		if(x*x == y*y + z*z)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
}

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

#define N 1000

struct{int a[3];} d[N];

int main(){
    int i,j,L;
    int longest,small;
    scanf("%d",&j);
    for(i=0; i<j&&i<N; scanf("%d %d %d",&d[i].a[0],&d[i].a[1],&d[i].a[2]),i++);
    L=i;
    for(i=0;i<L;i++){        
        longest=0;
        for(j=0;j<3;j++)
            if(longest<d[i].a[j])
                longest=d[i].a[j];
        for(j=0;j<3;j++)
            if(d[i].a[j]!=longest)
                small+=pow(d[i].a[j],2);
        if(small==pow(longest,2))
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}

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

int main() {

    int N;
    cin >> N;

    int a, b, c;

    for(int i = 0; i < N; i++) {
        cin >> a >> b >> c;

        vector<int> vec;

        vec.push_back(a);
        vec.push_back(b);
        vec.push_back(c);

        sort(vec.begin(), vec.end(), greater<int>());

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

    return 0;
}

C++: #include <stdio.h>

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

	scanf("%d",&n);
	for(loop_i = 0;loop_i < n;loop_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)
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}

C++: #include <iostream>

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

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

int main()
{
	while (true) {
	    static int x;
	    static int y;
	    static int z;
	    static bool flag[3];
	    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<bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin >> N;
  for(int i = 0; i < N; i++){
    int a, b, c;
    cin >> a >> b >> c;
    cout << (pow(a, 2) == pow(b, 2) + pow(c, 2) || pow(b, 2) == pow(a, 2) + pow(c, 2) || pow(c, 2) == pow(a, 2) + pow(b, 2) ? "YES" : "NO") << endl;
  }
}

C++: #include<iostream>
int main(){
	int n;
	std::cin>>n;
	for(int i=0;i<n;i++){
		int a=0,b=0,c=0;
		std::cin>>a>>b>>c;
		if(a>b&&a>c&&a*a==b*b+c*c){
			std::cout<<"YES"<<std::endl;
		}else if(b>a&&b>c&&b*b==a*a+c*c){
			std::cout<<"YES"<<std::endl;
		}else if(c>a&&c>b&&c*c==a*a+b*b){
			std::cout<<"YES"<<std::endl;
		}else std::cout<<"NO"<<std::endl;
	}
	return 0;
}

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

 using namespace std;

 int main() {
	int num;
	int x,y,z;
	 int answer;
	
	 cin >> num;
	
	 for(int i = 1; i <= num; i++){
		cin >> x >> y >> z;
		 if(x<y)
			 swap(x,y);
		 if(x<z)
			 swap(x,z);
		 if(y<z)
			 swap(y,z);
		
		 if((y*y + z*z)==x*x)
			 cout <<"YES"<<endl;
		 else
			cout << "NO" << endl;
	 }
	
	 return 0;
 }

C++: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace P0003_Is_it_a_Right_Triangle
{
    class Program
    {
        static void Main(string[] args)
        {

            List<string> lines = new List<string>();

            int cntLine = int.Parse(Console.ReadLine());

            for(int i = 1; i <= cntLine; i++)
            {
                lines.Add(Console.ReadLine());
            }          

            foreach (string line in lines)
            {
                List<string> sidesStr = line.Split(' ').ToList<string>();
                List<int> sides = new List<int>();

                foreach (string sideStr in sidesStr)
                {
                    sides.Add(int.Parse(sideStr));
                }

                sides.Sort();

                if (Math.Pow(sides[2], 2) == Math.Pow(sides[0], 2) + Math.Pow(sides[1], 2))
                {
                    Console.WriteLine("YES");
                }
                else
                {
                    Console.WriteLine("NO");
                }

            }


        }
    }
}

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

int main(){
  using namespace std;
  int num;
  int line[1000][3];

  cin>>num;
  for(int i=0;i<num;i++){
    cin>>line[i][0]>>line[i][1]>>line[i][2];
    sort(line[i],line[i]+3);
  }
  for(int i=0;i<num;i++){
    if(((line[i][0]*line[i][0])+(line[i][1]*line[i][1]))==(line[i][0]*line[i][0]))cout<<"YES"<<endl;
    else
      cout<<"NO"<<endl;
  }
  return 0;
}

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

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;
		if (a < b) 
			swap(a,b);
		if (a < c)
			swap(a, c);

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

C++: #include<stdio.h>
#include<string.h>
#define N 3

int main()
{
    int i, j, a, b, c;
    int A[N][N];

    scanf("%d",&a);
    for(i=0;i<a;i++){
        for(j=0;j<a;j++){
            scanf("%d", &b);
            if(j!=0 && b<A[i][j-1]){
                c = A[i][j-1];
                A[i][j-1] = b;
                A[i][j] = c;
            }else{
                A[i][j] = b;
            }   
        }   
            
    }   
    for(i=0;i<a;i++){
        if(A[i][0]*A[i][0]+A[i][1]*A[i][1]==A[i][2]*A[i][2]){
            printf("YES\n");
        }else{
            printf("NO\n");
        }   
    }   
    return 0;
}