Go: package main
import (
        "fmt"
)

func main() {
        var num int
        fmt.Scan(&num)

        for i := 0; i < num; i++ {
                s1 := 0
                s2 := 0
                s3 := 0
                var chk int = 0
                fmt.Scanf("%d %d %d", &s1, &s2, &s3)
                if s1 >= s2 {
                        if s1 > s3 {
                                chk = 1
                        } else {
                                chk = 3
                        }
                } else {
                        if s2 >= s3 {
                                chk = 2
                        } else {
                                chk = 3
                        }
                }

                if (chk == 1 && s1*s1 == s2*s2 + s3*s3) ||
                        (chk == 2 && s2*s2 == s3*s3 + s1*s1) ||
                        (chk == 3 && s3*s3 == s1*s1 + s2*s2) {
                        fmt.Printf("YES\n")
                } else {
                        fmt.Printf("NO\n")
                }
        }
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<math.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int N;

int main(){
    cin>>N;
    int a[N][3];
    rep(i,N){
        rep(j,3){
            cin>>a[i][j];
        }
        sort(a[i],a[i]+3);
        if(pow(2,a[i][0])+pow(2,a[i][1])==pow(2,a[i][2])){
            out("Yes");
        }
        else{
            out("No");
        }
    }
}

C++: int main()
{
	int a,b,c;
	int x=0;
	int n;
	cin >> n;
	for(int i=0 ;i<n ;i++){
		cin >> a >> b >> c;
		if(a<b && c<b){
			x=a;
			a=b;
			b=x;
		}
		else if(a<c && b<c){
			x=a;
			a=c;
			c=x;
		}

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

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

using namespace std;

int main(){
	int n,a,b,c;
	int m=0;
	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);
		
		int d = 50;
		if(a[0]>d || a[1]>d || a[2]>d)puts("hogehogehoge");
		
		if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]){
			puts("YES");
		}else{
			puts("NO");
		}
	}
}

C++: #include<iostream>
using namespace std;
int main() {
	int N,a,b,c;
	cin >> N;
	for (int i = 1; i <= N; i++) {
		cin >> a >> b >> c;
		if (a >= b) {
			if (a + b > c&&c > a - b) {
				cout << "Yes" << endl;
			}
			else {
				cout << "No" << endl;
			}
		}
		else if (a < b) {
			if (a + b > c&&c > b - a) {
				cout << "Yes" << endl;
			}
			else {
				cout << "No" << endl;
			}
		}
	}
}

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

int main(void) {
    int m;
    int n; cin >> n;
    int a[3];
    for(int i = 0; i < n; i++) {
        cin >> a[0] >> a[1] >> a[2];
        m = max(max(a[0], a[1]), a[2]);
        if(m * m == (a[0] < m)*a[0]*a[0] + (a[1] < m)*a[1]*a[1] + (a[2] < m)*a[2]*a[2]) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}

C++: #include <bits/stdc++.h>
using namespace std;

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

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
int main(){
  int n;
  cin >> n;
  int a[3];
  rep(i,n){
    rep(j,3){
      cin >> a[j];
    }
    sort(a,a+3);
    //rep(i,3) cout << a[i] << " ";
    if(a[2]*a[2] == a[0]*a[0] + a[1]*a[1]) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

C++: 

#include<stdio.h>
#include<stdbool.h>
 
bool right_triangle(int x, int y, int z); 
 
int main(void)
{
    int n, a, b, c;
    scanf("%d",&n);
    for(int i = 0; i < n; i++){
        scanf("%d %d %d", &a, &b, &c);
        if(right_triangle(a, b, c)){
            printf("YES\n");
        }else{
            printf("NO/n");
        }
    }
    return 0;
}
 
bool right_triangle(int x, int y, int z)
{
    if(x*x + y*y = z*z || x*x  +  z*z = y*y || z*z + y*y = x*x ){
        return true;
    }
    return false;
}        
 

 
Compile Error Logs: 

code.cpp: In function ‘bool right_triangle(int, int, int)’: 
code.cpp:23:60: error: lvalue required as left operand of assignment 

 
 
Status 
Judge: 0/1  C++  CPU: 00.00 sec  Memory: 0 [KB]  Length: 514 [B]  2014-07-10 01:35  2014-07-10 01:35  
Results for testcases 

















 Case #1:  : Compile Error  - - -  NA  -  NA  



 < | 1 /  1 | >     : Compile Error        -        - 

 

Input #1 (  )  Output #1 (  ) 

Not available.
  
Not available.
 

Comments 
 

 Under Construction. 

 
Categories 
 



 
Free Tags

C++: #include<iostream>
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 ^ 2) == (b ^ 2 )+ (c ^ 2) )||(( b ^ 2) == (a ^ 2) + (c ^ 2) )|| ((c ^ 2) == (a ^ 2) + (b ^ 2))) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#define NMAX (1000)
using namespace std;
int main(void){
    
    int N = 0;
    int a=0;
    int b=0;
    int c=0;

    //N??°?????\???
    scanf("%d",&N);
    
    //N?????°???????????????a,b,c???????????????
    for(int Ncount = 0; Ncount < N; Ncount++){
        scanf("%d %d %d",&a,&b,&c);
        if( ((a*a) + (b*b))  == (c*c) ){ 
            printf("YES\n"); 
        }else if( (b*b) + (c*c)  == (a*a) ){
            printf("YES\n"); 
        }else if( (c*c) + (b*b)  == (a*a) ){ 
            printf("YES\n"); 
        }else{ 
            printf("NO\n"); 
        }
    }
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define MOD 1000000007 //10^9+7
#define INF 1000000000 //10^9

char m[500][500];

int main ()
{
    int H,W;
    cin>>H>>W;
    
    for (int i=0; i<H; i++) {
        for (int j=0; j<W; j++) {
            cin>>m[i][j];
        }
    }
    
    queue<pint < pint > >;
    return 0;
}

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

void swap(int *,int *);
int search(int,int,int);
int correct[201][3];

int main(void)
{
	int a,b,c;
	int i,n;
	scanf("%d",&n);
	for(i=1;i<=200;i++){
		correct[i][0]=3*i;
		correct[i][1]=4*i;
		correct[i][2]=5*i;
	}
	for(i=0;i<n;i++){
		scanf("%d %d %d",&a,&b,&c);
		if(b<a)swap(&a,&b);
		if(c<b)swap(&b,&c);
		if(b<a)swap(&a,&b);
		if( search(a,b,c) ) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

void swap(int *a,int *b){
	int work;
	work=*a;
	*a=*b;
	*b=work;
}

int search(int a,int b,int c){
	int i;
	for(i=1;i<201;i++){
		if( (correct[i][0]==a) && (correct[i][1]==b) && (correct[i][2]==c) ) return 1;
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

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

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

}

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