Go: ///
// File:  0582.go
// Author: ymiyamoto
//
// Created on Wed Feb 28 22:51:48 2018
//
package main

import (
	"bufio"
	"fmt"
	"os"
)

const (
	steep = iota
	orth
	obtuse
)

func max(a, b, c int) (int, int, int) {
	if a < b {
		if b < c {
			return c, a, b
		} else {
			return b, c, a
		}
	} else {
		if a < c {
			return c, a, b
		} else {
			return a, b, c
		}
	}
}

func triangle(a, b, c int) int {
	if a*a == b*b+c*c {
		return orth
	} else if b*b+c*c-a*a > 0 {
		return steep
	} else {
		return obtuse
	}
}

func main() {
	s := bufio.NewScanner(os.Stdin)

	var num, st, or, ob int
	for s.Scan() {
		var a, b, c int
		fmt.Sscan(s.Text(), &a, &b, &c)

		m, n1, n2 := max(a, b, c)
		if m < n1+n2 {
			switch triangle(m, n1, n2) {
			case steep:
				st++
			case orth:
				or++
			case obtuse:
				ob++
			}
			num++
		} else {
			break
		}
	}
	fmt.Println(num, or, st, ob)
}

C++: #include<stdio.h>
int main(void)
{
	int n;
	int a[100],b[100],c[100];
	int d,e,f;
	int s;
	int i;
	int flg[100];
	int cnt,cnt1,cnt2,cnt3;
	int max;
	cnt=cnt1=cnt2=cnt3=0;
	
	for(i=0;i<5;i++){
		scanf("%d %d %d",&a[i],&b[i],&c[i]);
	}
	for(i=0;i<5;i++){
		d=a[i]*a[i];
		e=b[i]*b[i];
		f=c[i]*c[i];
		if(c[i]>=a[i] && c[i]>=b[i] && c[i]<a[i]+b[i] || b[i]>=a[i] && b[i]>=c[i] && b[i]<c[i]+a[i] || a[i]>=c[i] && a[i]>=b[i] && a[i]<b[i]+c[i]){
			cnt++;
			if(c[i]>=a[i] && c[i]>=b[i]){
				s=f-d-e;
				if(s==0){
					cnt1++;
				}
				else if(s<0){
					cnt2++;
				}
				else if(s>0){
					cnt3++;
				}
			}
			else if(b[i]>=a[i] && b[i]>=c[i]){
				s=e-d-f;
				if(s==0){
					cnt1++;
				}
				else if(s<0){
					cnt2++;
				}
				else if(s>0){
					cnt3++;
				}
			}
			else if(a[i]>=c[i] && a[i]>=b[i]){
				s=d-f-e;
				if(s==0){
					cnt1++;
				}
				else if(s<0){
					cnt2++;
				}
				else if(s>0){
					cnt3++;
				}
			}
		}
		else if(c[i]>=a[i] && c[i]>=b[i] && c[i]>=a[i]+b[i] || b[i]>=a[i] && b[i]>=c[i] && b[i]>=c[i]+a[i] || a[i]>=c[i] && a[i]>=b[i] && a[i]>=b[i]+c[i]){
			break;
		}
	}
	printf("%d %d %d %d\n",cnt,cnt1,cnt2,cnt3);
	return 0;
}

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

using namespace std;

int data[3];
int ans[4];

int main(){

  
  while(cin >> data[0] >> data[1] >> data[2]){
    sort(data,data+3);
    if(data[0] + data[1] <= data[2]) break;
    ans[0]++;

    int tmp = data[0]*data[0]+data[1]*data[1];

    if(tmp > data[2]*data[2]) ans[1]++;
    if(tmp == data[2]*data[2]) ans[2]++;
    if(tmp < data[2]*data[2]) ans[3]++;
  }

  cout << ans[0] << " " << ans[2] << " " << ans[1] << " " << ans[3] << endl;
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a, b, c;
  int p = 0, q = 0, r = 0, s = 0;
  while(scanf("%d %d %d\n", &a, &b, &c)){
    int maxx = a;
    if(maxx < b) maxx = b;
    if(maxx < c) maxx = c;
    if( 2 * maxx < a + b + c ) {
      p++;
      if(2 * pow(maxx, 2) == a*a + b*b + c*c) q++;
      else if(2 * pow(maxx,2) < a*a + b*b + c*c) r++;
      else s++;
    }
  }
  printf("%d %d %d %d\n", p, q, r ,s);

  return 0;
}

C++: #include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int cnt;
	int a,b,c;
	a = b = c = cnt = 0;
	while(true){
		int A[5];
		for(int i = 0; i < 3; i++){
			int tmp;
			scanf("%d",&tmp);
			A[i] = tmp;
		}
		sort(A,A+3);
		if(A[2] >= A[1] + A[0])break;
		cnt++;
		if(A[0]*A[0] + A[1]*A[1] == A[2]*A[2])a++;
		else if(A[0]*A[0] + A[1]*A[1] > A[2]*A[2])b++;
		else if(A[0]*A[0] + A[1]*A[1] < A[2]*A[2])c++;
	}
	printf("%d %d %d %d\n",cnt,a,b,c);
	return 0;
}

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

enum{TRIANGLE, RIGHT, ACUTE, OBTUSE, N};

int main()
{
    vector<int> count(N, 0);
    vector<int> edge(3);
    while(cin>>edge[0]>>edge[1]>>edge[2]) {
        sort(edge.begin(), edge.end(), greater<int>());

        if(edge[0] < edge[1] + edge[2]) {
            count[TRIANGLE]++;
        } else {
            cout<<count[TRIANGLE];
            for(int i=1; i<N; i++) cout<<" "<<count[i];
            cout<<endl;
            break;
        }

        int d = edge[0]*edge[0] - edge[1]*edge[1] - edge[2]*edge[2];
        if(d == 0) {
            count[RIGHT]++;
        } else if(d < 0) {
            count[ACUTE]++;
        } else if(d > 0) {
            count[OBTUSE]++;
        }
    }
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

void sort(int *a, int *b, int *c){
  int tmp;
  if(*a == max(*a, max(*b, *c))){
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }else if(*b == max(*b, *c)){
    tmp = *a, *a = *b, *b = tmp;
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }else{
    tmp = *a, *a = *c, *c = tmp;
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }
}

int judge(int a, int b, int c){ // 1:直角三角形 2:鋭角三角形 3:鈍角三角形
  if(SQ(a) == SQ(b) + SQ(c)) return 1;
  if(SQ(a) < SQ(b) + SQ(c)) return 2;
  if(SQ(a) > SQ(b) + SQ(c)) return 3;
  return 0;
}

int main(){
  int A, B, C;
  ll res[4];
  memset(res, 0, sizeof(res));
  while(cin >> A >> B >> C){
    sort(&A, &B, &C);
    if(A >= B + C) break;
    res[0]++;
    res[judge(A, B, C)]++;
  }

  cout << res[0] << " " << res[1] << " " << res[2] << " " << res[3] << endl;
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
main(){
  int tri[3];
  int s = 0, e = 0, t = 0, d = 0;
  while (cin>>tri[0]>>tri[1]>>tri[2]){
    sort(tri,tri+3);
    if (tri[2]>=tri[0]+tri[1]) break;
    s++;
    if (tri[2]*tri[2]==tri[0]*tri[0]+tri[1]*tri[1]) t++;
    if (tri[2]*tri[2]>tri[0]*tri[0]+tri[1]*tri[1]) d++;
    if (tri[2]*tri[2]<tri[0]*tri[0]+tri[1]*tri[1]) e++;
  } 
  cout <<s<<" "<<t<<" "<<e<<" "<<d<< endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int a,b,c,l=0,m=0,n=0,o=0;
    while(1){
         cin>>a>>b>>c;
         if(a+b>c&&b+c>a&&a+c>b){
           l+=1;
           if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a){
             m+=1;
           }
           int j=0;
           if(j<a){
           j+=a;
           }
           if(j<b){
           j+=b;
           }
           if(j<c){
           j+=c;
           }
           if(j==a){
             if(a*a<b*b+c*c){
               n+=1;
             }
             if(a*a>b*b+c*c){
               o+=1;
             }
           }
           else if(j==b){
             if(b*b<a*a+c*c){
               n+=1;
             }
             if(b*b>a*a+c*c){
               o+=1;
             }
           }
           else{
                  if(c*c<b*b+a*a){
                    n+=1;
                  }
                  if(c*c>b*b+a*a){
                    o+=1;
                  }
           }
         }
         else{break;}
     }
     cout<<l<<" "<<m<<" "<<n<<" "<<o<<endl;
     return 0;
}

C++: #include <iostream>
using namespace std;
int max(int a,int b,int c){
	if(a>b&&a>c)return a;
	else if(b>a&&b>c)return b;
	else return c;
}

int main() {
	int a,b,c,wa,WA;
	int p=0,q=0,r=0,s=0;
	for(int x=p;x==x;p++){
		a=0;
		b=0;
		c=0;
		cin>>a>>b>>c;
		wa=a+b+c;
		WA=a*a+b*b+c*c;
		if(2*max(a,b,c)>=wa)break;
		else if(2*max(a,b,c)*max(a,b,c)==WA)q++;
		else if(2*max(a,b,c)*max(a,b,c)<WA)r++;
		else s++;
		}
		cout<<p<<' '<<q<<' '<<r<<' '<<s<<'\n';
	return 0;
}