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>
#include <algorithm>
using namespace std;

int main()
{
	int N;
	cin >> N;
	int A[3];
	for (int i = 0; i < N; i++) {
		bool f = false;
		for (int j = 0; j < N; j++) {
			cin >> A[j];
		}
		sort(A, A + 3);
		if ((A[0] * A[0] + A[1] * A[1]) == (A[2] * A[2]))
			f = true;
		if(f)
			cout << "YES" << endl;
		else
			cout << "NO"<<endl;
	}
    return 0;
}

C++: main(a,b,c){for(gets());scnaf("%d%d%d",&a,&b,&c);puts((a+b-c&&b+c-a&&c+a-b)?"NO":YES"))a*=a,b*=b,c*=c;}

C++: #include<iostream>

using namespace std;

void swapof3(int&, int&, int&);
void swap(int&, int&);

int main(){
  int i, n;
  int a, b, c, d, e;
  cin >> n;

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

    swapof3(a, b, c);
    d = a*a + b*b;
    e = c*c;

    if(d == e)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}

void swapof3(int& a, int& b, int& c){
  if(a > b)
    swap(a, b);
  if(b > c)
    swap(b, c);
}

void swap(int& i, int& j){
  int k;
  k = i;
  i = j;
  j = k;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main( void )
{
  int n,x,y,z;
  cin >> n;
  for( int i=0; i<n; i++ ){
    cin >> x >> y >> z;
    if( cin.eof() ) break;
    if( x > y ) swap( x, y );
    if( x > z ) swap( x, z );
    if( y > z ) swap( y, z );
    if( x*x + y*y == z*z ) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,x); REP(i,sizeof(a)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

#define umap unordered_map
//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}

int main(){
  int N; cin>>N;
  REP(i,N){
    int a,b,c; cin>>a>>b>>c;
    if(a>b){ swap(a,b);}
    if(b>c){ swap(b,c);}
    cout<<( a*a+b*b==c*c ? LINY:LINN);
  }
}

C++: #include <stdio.h>

int main(void)
{
	int n;
	int i;
	int x, y, z;

	while (scanf("%d", &n) != EOF){
		for (i = 0; i < n; i++){
			scanf("%d %d %d", &x, &y, &z);

			if ((x * x == y * y + z * z) || (y * y == x * x + z * z) || (z * z == x * x + y * y)){
				printf("YES\n");
			}
			else {
				printf("NO\n");
			}
		}
	}
	return (0);
}

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

C++: #include <string>
#include <sstream>
#include <iostream>
#include <stack>
#include <queue>
#include <vector>
using namespace std;

vector<string> exinputstring(){
	vector<string> ss;
	string s;
	while(getline(cin,s) ){
		ss.push_back(s);
	}
	
	return ss;
}
vector<int> exinputint(){
	vector<int> ss;
	int d;
	while( !cin.eof() ) {
		cin >>d;
		ss.push_back(d);
	}
	return ss;
}

main(){
	vector<int> inp=exinputint();
	vector<int>::iterator it = inp.begin();
	for (it++;it != inp.end();){
		int a=*it;it++;
		int b=*it;it++;
		int c=*it;it++;
		if ((a>=b&&b>=c&&a*a==b*b+c*c)||
			(b>=a&&b>=c&&b*b==a*a+c*c)||
			(c>=a&&c>=b&&c*c==a*a+b*b)){
				cout<<"YES";}else{cout<<"NO";}

	}
}

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

int main(){
	int n;
	cin >> n;
	int a[n],b[n],c[n];
	string ans[n];
	for(int i = 0;i < n;i++){
		cin >> a[i] >> b[i] >> c[i];
		if(a[i]*a[i] == b[i]*b[i] + c[i]*c[i] || b[i]*b[i] == c[i]*c[i] + a[i]*a[i] || c[i]*c[i] == a[i]*a[i] + b[i]*b[i]) ans[i] = "YES";
		else ans[i] = "NO";
	}

	for(int i = 0;i < n;i++){cout << ans[i] << endl;}

	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){
	int a,b;
	
	while(scanf("%d",&a)!=EOF){
	scanf("%d",&b);
	a+=b;
	int i=0;
	for(i=0;a>=10;i++){
		a/=10;
	}
	
	if(a==0){
		cout<<0<<endl;
	}else{
	cout<<i+1<<endl;
	}
	}
}

C++: #include<cstdio>
#include<string>
#include<vector>
#include<fstream>
#include<iostream>
#include<stdlib.h>
#include<math.h>
#include<cwctype>
#include<algorithm>
#include<math.h>

using namespace std;

bool check(int x,int y,int z ){
	int m=max(max(y,z),x);
	x=(x==m)? 0 : x*x;
	y=(y==m)? 0 : y*y;

	z=(z==m)? 0 : z*z;
	if((x+y+z)==pow(m,2.0))return true;
	else false;

}
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int x,y,z;
		cin>>x>>y>>z;

		if(check(x,y,z)){
			cout<<"YES"<<endl;
		}
		else cout<<"NO"<<endl;


	}

		return 0;
}

C++: int main(){
	int n;
	cin>>n;
	int hen1,hen2,hen3,saidai;

	for(int i=0;i<n;i++){
	cin>>hen1>>hen2>>hen3;

	saidai=hen1;
	if(saidai<hen2){
		saidai=hen2;
		hen2=0;
	}
	else if(saidai<hen3){
		saidai=hen3;
		hen3=0;
	}
	else if(saidai==hen1)
		hen1=0;
	if(saidai*saidai==hen1*hen1+hen2*hen2+hen3*hen3)
		cout<<"YES"<<"\n";
	else{
		cout<<"NO"<<"\n";
	}
	}
	
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>

using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	while(n--){
		int a[3];
		for(int i=0;i<3;i++)
			cin>>a[i];
		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 <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

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

int main(void) {
    int num; cin >> num;
    vector<int> vec(3);
    for(int r = 0; r < num; r++) {
        cin >> vec[0] >> vec[1] >> vec[2];
        sort(vec.begin(), vec.end());
        cout << (isRightTriangle(vec[0], vec[1], vec[2]) ? "YES" : "NO") << endl;
    }
    return(0);
}