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>
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) || (b * b) + (a * a) == (c * c)){
				cout << "YES" << endl;
			}
			else{
				cout << "NO" << endl;
			}
	}
	return(0);
}

C++: #include <iostream>
using namespace std;
 
int main()
{
   int a,b,c,x, y, z,n;
 
   // read in n 
   cin>>n;

   // for n set of data, read into 3 sides 
   
   for(int i=0;i<=n;i++)
   {
      cin>>a>>b>>c;          
      x=a*a; y=b*b; z=c*c;
      
      // check if they are triangle
      if(x+y==z||x+z==y||y+z==x)
          cout<<"Yes"<<endl;
      else
          cout<<"No"<<endl;
    }   
    return 0;
}

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

void rightTriangle(int, int, int);
int main()
{
    int N;
    std::cin >> N;
    for (int i = 0; i < N; ++i) {
        int a, b, c;
        std::cin >> a >> b >> c;
        rightTriangle(a, b, c);
    }
    return 0;
}
void rightTriangle(int a, int b, int c)
{
    if (a * a + b * b == c * c
        || b * b + c * c == a * a
        || c * c + a * a == b * b) {
        std::cout << "YES" << std::endl;
    } else {
        std::cout << "NO" << std::endl;
    }
}

C++: /*
    AOJ Volume0 0003

        Is it a Right Triangle?

        Write a program which judges wheather given length of three side form a right triangle.
        Print "YES" if the given sides (integers) form a right triangle, "NO" if not so.
        
        Input
            Input consists of several data sets. In the first line, the number of data set, N is given.
            Then, N lines follow, each line corresponds to a data set.
             A data set consists of three integers separated by a single space.

        Constraints
            1 ≤ length of the side ≤ 1,000
            N ≤ 1,000

        Output
            For each data set, print "YES" or "NO".

        Sample Input
            3
            4 3 5
            4 3 6
            8 8 8

        Output for the Sample Input
            YES
            NO
            NO
*/

#include <iostream>


bool is_right_triangle(int edge1, int edge2, int edge3)
{
    int edge[3] = { edge1, edge2, edge3 };
    int longest = 0;
    int other1 = 1, other2 = 2;

    for(int i=1; i<3; ++i)
    {
        if(edge[i] > edge[longest])
        {
            longest = i;
            if(longest == 1){ other1 = 0; other2 = 2; }
            if(longest == 2){ other1 = 0; other2 = 1; }
        }
    }

    int aa = edge[other1] * edge[other1];
    int bb = edge[other2] * edge[other2];
    int cc = edge[longest] * edge[longest];

    return aa + bb == cc;
}


int main(void)
{
    int N;
    std::cin >> N;

    for(int i=0; i<N; i++)
    {
        int e, f, g;
        std::cin >> e >> f >> g;

        bool ans = is_right_triangle(e,f,g);
        std::cout << (ans ? "YES" : "NO") << std::endl;
    }

    return 0;
}

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

int main(void)
{
  int n;
  int a, b, c;
  int i;
  int temp;
  cin >> n;
  for(i = 0; i < n; i++){
    cin >> a >> b >> c;
    if(a < b){
      temp = a;
      a = b; 
      b = temp;
    }
    if(a < c){
      temp = a;
      a = c;
      c = temp;
    }
    
    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 a,b,c,d,i;
	cin>>i;
	for(int n=0;n<i;n++;){
 		cin>>a>>b>>c;
  		if(a<b){d=a,a=b,b=a;}
   		else if(a<c){d=a,a=c,c=d;}
   		if(a*a==b*b+c*c){cout<<"Yes"<<endl;}
   		else {cout<<"No"<<endl;}
   	}   
	return 0;
}

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int long long i=0;i<n;i++)
using namespace std;
char t[7];
int main(){
    int n;
    cin>>n;
    while(n>0){
    vector<int> v(3);
    rep(i,3){
        int x;
        cin>>x;
        v.push_back(x);
    }
    sort(v.begin(),v.end(),greater<int>());
    if(v[0]==sqrt(v[1]*v[1]+v[2]*v[2])){
        cout<<"YES"<<endl;
    }else{
        cout<<"N0"<<endl;
    }
        n--;
    }
    
    return 0;
}

C++: #include <stdio.h>

#define YES 1
#define NO 0

int tri_judge(int x, int y, int z);
int pow2(int x);

int main(void)
{
    int dataset;
    scanf("%d", &dataset);

    int side1, side2, side3;
    while (dataset--){
        scanf("%d %d %d", &side1, &side2, &side3);
        int yn = tri_judge(side1, side2, side3);
        if (yn == YES){
            printf("YES\n");
        } else {
            printf("NO\n");
        }

    }

    return 0;
}

int tri_judge(int x, int y, int z)
{
    int yn;

    if (pow2(x) == pow2(y) + pow2(z)){
        yn = YES;
    } else if (pow2(y) == pow2(z) + pow2(x)){
        yn = YES;
    } else if (pow2(z) == pow2(x) + pow2(y)){
        yn = YES;
    } else {
        yn = NO;
    }

    return yn;
}

int pow2(int x)
{
    return x * x;
}

C++: #include<iostream>

int main(){
	int a,b,c,i,n;

	std::cin>>n;

	for(i=0;i<n;i++){
		std::cin>>a>>b>>c;
		if(a*a==b*b+b*b){
			std::cout<<"YES"<<std::endl;
			}
		else if(b*b==a*a+c*c){
			std::cout<<"YES"<<std::endl;
			}
		else if(c*c==a*a+b*b){
			std::cout<<"YES"<<std::endl;
			}
		else std::cout<<"NO"<<std::endl;
		}

	return 0;
	}

C++: #include <iostream>

using namespace std;

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

C++: /* AOJ0003 */
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main(){
  int n;
  cin >> n;
  while(n--){
    int a, b, c;
    cin >> a >> b >> c;
    if(a < b) swap(a, b);
    if(a < c) swap(a, c);
    cout << (a * a == b * b + c * c ? "YES" : "NO" ) << endl;
  }
  return 0;
}

C++: #include<stdio.h>
int main()
{
	int x,N,L1,L2,L3,max,a1,a2;
	scanf("%d",&N);
	for(x=0; x<N; x++)
	{
		max=1;
		scanf("%d %d %d",&L1,&L2,&L3);
		if(L1<L2)
			max=2;
		if(L2<L3)
			max=3;
		if(max==1)
		{
			a1=L1*L1;
			a2=L2*L2+L3*L3;
			if(a1==a2)
				printf("YES\n");
			else
				printf("NO\n");
		}
		if(max==2)
		{
			a1=L2*L2;
			a2=L1*L1+L3*L3;
			if(a1==a2)
				printf("YES\n");
			else
				printf("NO\n");
		}
		if(max==3)
		{
			a1=L3*L3;
			a2=L1*L1+L2*L2;
			if(a1==a2)
				printf("YES\n");
			else
				printf("NO\n");
		}
	}
	return 0;
}

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

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

    int n,a,b,c;
    bool f;
    std::cin >> n;
    while (std::cin >> a >> b >> c) {
        f = false;
        if (c*c == a*a+b*b) {
            f = true;
        } else if (a*a == b*b+c*c) {
            f = true;
        } else if (b*b == c*c+a*a) {
            f = true;
        } else {
            std::cout << "NO" << std::endl;
        }
        if (f) {
            std::cout << "YES" << std::endl;
        }
    }
    return EXIT_SUCCESS;
}