Go: package main

import (
  "fmt"
)


func main() {
  var a int
  var b int
  var c int
  var n int
  fmt.Scan(&n)
  for _, err := fmt.Scan(&a, &b, &c); err == nil; _, err = fmt.Scan(&a, &b, &c) {
    if a*a == b*b+c*c {
      fmt.Println("YES")
    } else if b*b == c*c+a*a {
      fmt.Println("YES")
    } else if c*c == a*a+b*b {
      fmt.Println("YES")
    } else {
      fmt.Println("NO")
    }
  }
}

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  int a,b,c;
  int cnt[10000];
  memset(cnt,0,sizeof(cnt));
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a>>b>>c;
    if(a*a==b*b+c*c||b*b==a*a+c*c||c*c==a*a+b*b){
      cnt[i]=1;
    }
  }
  for(int i=0;i<n;i++){
    if(cnt[i]==1){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return(0);
}

C++: #include <bits/stdc++.h>
#ifdef dbg
#include "./printer.hpp"
#else
#define dump(x) void(0)
#endif

#define MOD 1000000007
using namespace std;
#define ll long long
inline long  toInt(string s) {long  v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

int main(){
  ll n;
  cin >> n;
  for(ll i = 0; i < n; i++){
    ll a,b,c;
    cin >> a >> b >> c;
    ll ma = max(a,b);
    ma = max(ma,c);
    if(a*a + b*b + c*c - ma*ma == ma*ma){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
}

C++: #include<iostream>
using namespace  std;
int main(){
	int N,a,b,c,d,i;
    cin>>N;
	for(i=0;i<N;i++){
		cin>>a>>b>>c;
	if(a<b){d=a,a=b,b=d;}
	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 <algorithm>

int main(int argc, char** argv)
{
  int N;

  std::cin >> N;

  int a[3];

  while (N --) {
    std::cin >> a[0] >> a[1] >> a[2];

    std::sort(a + 0, a + 3);

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

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

C++: #include <iostream>
#include <vector>
#include <math.h>

static const int DataMax = 1000;	// Max value of elements

typedef struct _triangle
{
    int count;	// Number of elements
    std::vector<int> vec[DataMax];
} triangle_t;

static void inputData(triangle_t& data, int& num)
{
    int v1, v2, v3;

    if (0x00 == &data) {
        std::cerr << "data is null" << std::endl;
        return;
    }

    std::cin >> num;
    for (int i = 0; i < num; i++) {
        std::cin >> v1 >> v2 >> v3;
        data.vec[data.count].push_back(v1);
        data.vec[data.count].push_back(v2);
	data.vec[data.count].push_back(v3);
        data.count++;
    }
}

static bool isRightTriangle(std::vector<int>& vec)
{
    if (0x00 == &vec) {
        std::cerr << "vec is null" << std::endl;
        return false;
    }

    if ((int)pow((double)vec.at(0), 2.0) + (int)pow((double)vec.at(1), 2.0) == (int)pow((double)vec.at(2), 2.0)) {
        return true;
    } else if((int)pow((double)vec.at(1), 2.0) + (int)pow((double)vec.at(2), 2.0) == (int)pow((double)vec.at(0), 2.0)) {
        return true;
    } else if ((int)pow((double)vec.at(0), 2.0) + (int)pow((double)vec.at(2), 2.0) == (int)pow((double)vec.at(1), 2.0)) {
        return true;
    }

    return false;
}

int main()
{
    triangle_t triangle = {0};
    int num = 0;

    inputData(triangle, num);
    for (int i = 0; i < num; i++) {
        if (true == isRightTriangle(triangle.vec[i])) {
            std::cout << "YES" << std::endl;
        } else {
            std::cout << "NO" << std::endl;
        }
    }

    return 0;
}

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

int main() {
	int N;
	cin >> N;
	vector<int> a(3);
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 3; j++) {
			cin >> a[j];
			a[j] = pow((double)a[j], 2);
		}
		sort(a.begin(), a.end());			
		if (a[0] + a[1] == a[2]) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
		for (int j = 0; j < 3; j++) {
			a[j] = 0;
		}
	}
	return 0;
}

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

int main()
{
	int n;
	for (cin >> n; n; n--) {
		vector<int> tri;
		for (int i = 0; i < 3; i++) {
			int a;
			cin >> a;
			tri.push_back(a);
		}
		sort(tri.begin(), tri.end());
		cout << (pow(tri[2], 2) == pow(tri[1], 2) + pow(tri[0], 2) ? "YES" : "NO") << endl;
	}

	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct{
    int m[3];
}triangle;

int main( void ){

    triangle *tri;
    int e;
    scanf( "%d",&e );
    if(( tri = ( triangle * ) malloc( sizeof( triangle ) * e )) == NULL ) return -1;
    for( int i = 0;i < e;i++ )scanf( "%d %d %d",
                                        &tri[i].m[0],&tri[i].m[1],&tri[i].m[2] );

    for( int i = 0;i < e;i++ ){
        for( int k = 0;k < 2;k++ ){
            for( int j = 0;j < 2;j++ ){
                if( tri[i].m[j] => tri[i].m[j+1] ){
                    int buf = tri[i].m[j];
                    tri[i].m[j] = tri[i].m[j+1];
                    tri[i].m[j+1] = buf;
                }
            }
        }
        if( tri[i].m[0] * tri[i].m[0] + tri[i].m[1] * tri[i].m[1] == tri[i].m[2] * tri[i].m[2] ) 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;
		a*=a;
		b*=b;
		c*=c;
		if(a+b==c||a==b+c||a+c==b){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int n;
    int a,b,c;

    cin >> n;

    for(int i=0; i<3; ++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 << "NO" << endl;
        }
        else{
            cout << "YES" << endl;
        }
    }

    return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
  int n;
  int a,b,c;
  int tmp;
  cin >> n;
  for(int i=0;i<n;i++)
    {
      cin >> a >> b >> c;
    }

  if(a>c){
    tmp=a;
    a=c;
    c=tmp;
  }
  if(b>c){
    tmp=b;
    b=c;
    c=tmp;
  }

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
int main(){
  using namespace std;
  int N;
  cin >> N;
  for(int i = 0; i < N; i++){
    vector<int> edge(3);
    for(int j = 0; j < 3; j++){
      cin >> edge[j];
    }
    sort(edge.begin(), edge.end());
    int l,m,s;
    s = edge[0];
    m = edge[1];
    l = edge[2];
    if(l*l == m*m + s*s){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
}