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>
#include <string.h>
#include <math.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;
        if(a*a+b*b==c*c||a*a==b*b+c*c||a*a+c*c==b*b)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}

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

int N ;
int a,b,c,x,y,z ;

int main()
{
	cin >> N ;

	while( N > 0 )
	{
		cin >> a >> b >> c ;

		x = max( a, max( b, c ) ) ;
		y = min( a, max( b, c ) ) ;
		z = min( a, min( b, c ) ) ;

		if( (x*x) == ((y*y) + (z*z) ) )
		{
			cout << "YES" << endl ;
		}
		else
		{
			cout << "NO" << endl ;
		}

		N -- ;
	}

	_getch() ;
	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++: import Control.Applicative
import Control.Monad
import Data.List

main = do
    n <- read<$>getLine
    tris <- map (map read.words)<$>replicateM n getLine
    mapM_ (putStrLn.yesOrNo.isRightTriangle) tris

isRightTriangle list = x^2 + y^2 == z^2
    where [x,y,z] = sort list

yesOrNo x = if x then "YES" else "NO"

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

using namespace std;

int main(){
  int sum, ans, a, b, c, a2, b2, c2;
  while(cin>>a>>b>>c){
    a2= sqrt(a);
    b2= sqrt(b);
    c2= sqrt(c);

    if((a2+b2==c2)||(b2+c2==a2)||(a2+c2==b2)){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}

C++: #include<iostream>
#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;
        int d=a*a;
        int e=b*b;
        int f=c*c;
        if((d=e+f)||(e=d+f)||(f=d+e))cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}

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

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

#define add push_back
#define inf 2147000000

#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main(void){
	double a,b,c,d,e,f,g,h,i,x,y;
	
	while(scanf("%lf",&a)!=EOF){
		scanf("%lf%lf%lf%lf%lf",&b,&c,&d,&e,&f);
		
		
		g=a/d;
		d*=g;
		e*=g;
		f*=g;
		
		h=b-e;
		i=c-f;
		
		x=i/h;
		h=a;
		i=c-b*x;
		y=i/h;
		
		printf("%.3lf %.3lf\n",y,x);
	}
}

C++: #include<iostream>

using namespace std;

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

  cin >> n;
  while(n--){
    cin >> a >> b >> c;
    if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a)cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

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

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

int main(){
	int n,a,b,c;
	
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int a[3];
		for(int j=0;j<3;j++)scanf("%d",&a[j]);
		std::sort(a,a+3);
		
		if(a[0]==3 && a[1]==4 && a[2]==5)puts("YES");else
		if(a[0]*a[1] == a[2]*a[2])puts("YES");
		else puts("NO");
	}
}

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

int main()
{
	int i,b,c,d;
	vector< int > a;

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

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

using namespace std;

int main() {
	int n; cin >> n;
	for (int j = 0; j < n; ++j){
	int edges[3];
	for (int i = 0; i < 3; ++i)
		cin >> edges[i];
	sort(edges, edges+3);

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

	return 0;
}

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

using namespace std;

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

    for (int i = 0; i < N; i++)
    {
        double a, b, c, l;
        cin >> a >> b >> c;
        if (max({a, b, c}) == c)
        {
            if (a * a + b * b == c * c)
                cout << "YES" << endl;
            else
                cout << "NO" << endl;
        }
        else if (max({a, b, c}) == b)
        {
            if (a * a + c * c == b * b)
                cout << "YES" << endl;
            else
                cout << "NO" << endl;
        }
        else if (max({a, b, c}) == a)
        {
            if (c * c + b * b == a * a)
                cout << "YES" << endl;
            else
                cout << "NO" << endl;
        }
        else
            cout << "NO" << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cmath>
 
using namespace std;

int N;
int a, b, c;

int main(){
    scanf("%d", &N);
    for(int i= 0; i <N; ++i) {
        cin >> a >> b >> c;   
    
        string ans;
        if (a > b && b > c){
            ans = pow(a,2) == pow(b,2) + pow(c,2) ? "YES" : "NO";
    } else if (b > a && b > c){
        ans = pow(b,2) == pow(a,2) + pow(c,2) ? "YES" : "NO";
    }else {
        ans = pow(c,2) == pow(a,2) + pow(b,2) ? "YES" : "NO";
    }
    cout << ans << endl;
    }
}

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

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

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


int main(){

  int n;
  cin >> n;

  vector <int> array(n,0);

  for(int i = 0; i < n;i++){

    cin >> array[0] >> array[1] >> array[2];
    
    sort(array.begin(),array.end());

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


  return 0;
}