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

int main() {
  int p,q,r,s;
  p = q = r = s = 0;
  int x,y,z;
  while(cin>>x>>y>>z) {
    vector<int> v(3);
    v[0] = x, v[1] = y, v[2] = z;
    sort(v.begin(), v.end());

    x = v[0], y = v[1], z = v[2];
    if (z >= x+y) {
      cout<<p<<" "<<q<<" "<<r<<" "<<s<<endl;
      break;
    }

    p++;
    if (x*x + y*y == z*z) {
      q++;
    } else if (x*x + y*y > z*z) {
      r++;
    } else {
      s++;
    }
  }
}

C++: #include <bits/stdc++.h>

using namespace std;

int a1,a2,a3,a4;

int main(){

	int a,b,c;
	int h[4];
	while(cin >> h[0] >> h[1] >> h[2]){
		sort(h,h+3);
		a = h[0];
		b = h[1];
		c = h[2];

		if(a+b > c){
			a1++;
			if(a*a + b*b == c*c)a2++;
			else if(a*a + b*b > c*c)a3++;
			else a4++;
		}else{
			printf("%d %d %d %d\n",a1,a2,a3,a4);
			break;
		}
	}
	return 0;
}

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

main(){
  int l[3], cnt[4];
  for ( int i = 0; i < 4; i++ ) cnt[i] = 0;

  while(cin >> l[0] >> l[1] >> l[2]){

    sort(l, l+3);
    if ( l[0] + l[1] <= l[2] ) {
      for ( int i = 0; i < 4; i++ ){
	if ( i ) cout << " ";
	cout << cnt[i];
      }
      return 0;
    }

    cnt[0]++;
    if ( l[0]*l[0] + l[1]*l[1] == l[2]*l[2] ) cnt[1]++;
    else if  ( l[0]*l[0] + l[1]*l[1] < l[2]*l[2] ) cnt[3]++;
    else cnt[2]++;

  }
}

C++: #include<iostream>
using namespace std;
int main(){
	int i,x,y ,z,a,b,c,ch=0,ei=0,d=0;

	for(i=0;i<100;i++)
	{
		cin>>x>>y>>z;

		if(x>=y && y>=z) 
		{
			a=x;
			b=y;
			c=z;
		}
		else if(y>=x  && x>=z)
		{
			a=y;
			b=x;
			c=z;
		}
		else //(z>=x && x>=y)
		{
			a=z;
			b=y;
			c=x;
		}
		if(b+c<=a)
		{
			break;
		}               
		if (a*a<b*b+c*c)
		{
			ei+=1;
		}
		else if (a*a>b*b+c*c)
		{
			ch+=1;
		}
		else
		{
			d+=1;
		}
	}

	cout<<ch+d+ei<<" "<<ch<<" "<<ei<<" "<<d<<endl;
	return 0;
}

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

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

typedef long long ll;

int main(){
    int a,b,c;
    int d,e,f;
    d = e = f = 0;
    while(true){
        cin >> a >> b >> c;
        if(!(a < b + c && b < a + c && c < a + b)){
            break;
        }
        vector<int> vec;
        vec.push_back(a);
        vec.push_back(b);
        vec.push_back(c);
        sort(vec.begin(),vec.end());
        int p = vec[0] * vec[0] + vec[1] * vec[1];
        int g = vec[2];
        if(p == g*g){
            e++;
        }else if(p>g*g){
            d++;
        }else{
            f++;
        }
    }
    cout << d + e + f << " " << d <<  " " << e << " " << f << endl;
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int i,x,y ,z,a,b,c,ch=0,ei=0,d=0;

	for(i=0;i<100;i++)
	{
		cin>>x>>y>>z;

		if(x>=y && y>=z) 
		{
			a=x;
			b=y;
			c=z;
		}
		else if(y>=x  && x>=z)
		{
			a=y;
			b=x;
			c=z;
		}
		else //(z>=x && x>=y)
		{
			a=z;
			b=y;
			c=x;
		}

		if(b+c<=a)
		{
			break;
		}  

		a = a*a;
		b = b*b;
		c = c*c;

		if (a-(b+c)<0)
		{
			ei+=1;
		}

		if (a-(b+c)>0)
		{
			d+=1;
		}

		if(a == b+c)
		{
			ch+=1;
		}

		
	}

	cout<<ch+d+ei<<" "<<ch<<" "<<ei<<" "<<d<<endl;



	return 0;
}

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

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

typedef long long ll;

int main(){
    int a,b,c;
    int d,e,f;
    d = e = f = 0;
    while(true){
        cin >> a >> b >> c;
        if(!(a < b + c && b < a + c && c < a + b)){
            break;
        }
        vector<int> vec;
        vec.push_back(a);
        vec.push_back(b);
        vec.push_back(c);
        sort(vec.begin(),vec.end());
        int p = vec[0] * vec[0] + vec[1] * vec[1];
        int g = vec[2];
        if(p == g*g){
            d++;
        }else if(p>g*g){
            e++;
        }else{
            f++;
        }
    }
    cout << d + e + f << " " << d <<  " " << e << " " << f << endl;
    return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://onlinejudge.u-aizu.ac.jp/challenges/sources/JOI/Prelim/0582?year=2006>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    vector<ll> ans(4);
    
    ll a,b,c;
    while(cin >> a >> b >> c){
        vector<ll> abc = {a,b,c};
        sort(abc.rbegin(),abc.rend());
        a = abc[0]; b = abc[1]; c = abc[2];
        
        if(b+c>a){
            ans[0]++;
            
            if(a*a == b*b+c*c){
                ans[1]++;
            }else if(a*a > b*b + c*c){
                ans[3]++;
            }else{
                ans[2]++;
            }
        }else{
            cout << ans << endl;
            break;
        }
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    solve(0);
    // cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}