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

bool exist(int a,int b,int c){
    bool flag=false;
    if(a+b>c&&a+c>b&&c+b>a)flag=true;
    return flag;
}
int type_check(int a,int b,int c){
    if(a*a+b*b==c*c)return 1;
    else if(a*a<b*b+c*c)return 0;//鋭角
    else if(a*a>b*b+c*c)return 2;
    else return 3;
}

int main(){
    int a,b,c,c1=0,c2=0,c3=0,c4=0;
    while(true){
        cin >> a>>b>>c;

        if(!exist(a,b,c))break;
        switch(type_check(a,b,c)){
            case 0: c1++; break;
            case 1: c2++; break;
            case 2: c3++;break;
        }
        c4++;
    }
    cout <<c4<<" "<<c2<<" "<<c1<<" "<<c3<<" " <<endl;
}

C++: #include <bits/stdc++.h>
#define FOR(I,X,Y) for(int I=X;I<Y;I++)
#define REP(I,X,Y) for(int I=Y-1;I>=X;I--)
#define INF 1000000007
using namespace std;

int main(){
  int a,b,c;
  int ans1=0,ans2=0,ans3=0,ans4=0;
  while(1){
    cin >> a >> b >> c;
    if(b < a)swap(a,b);
    if(c < b)swap(b,c);
    if(c >= a+b)break;
    ans1++;
    if(a*a+b*b==c*c)ans2++;
    if(a*a+b*b>c*c)ans3++;
    if(a*a+b*b<c*c)ans4++;
  }
  cout << ans1 << " " << ans2 << " " << ans3 << " " << ans4 << endl;
}

C++: #include <bits/stdc++.h>
#define sqr(x) ((x) * (x))
using namespace std;
int a[3], p, q, r;
int main() {
    ios::sync_with_stdio(false);
    while(cin >> a[0] >> a[1] >> a[2]) {
        sort(a, a + 3);
        if(a[0] + a[1] <= a[2]) break;
        if(sqr(a[0]) + sqr(a[1]) == sqr(a[2])) p++;
        else if(sqr(a[0]) + sqr(a[1]) > sqr(a[2])) q++;
        else r++;
    }
    cout << p + q + r << ' ' << p << ' ' << q << ' ' << r << endl;
    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <ctime>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <numeric>
#include <cassert>
using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define mp(a,b,c) make_pair(make_pair(a,b),c)
#define pb(a) push_back(a)
#define SS stringstream
#define DBG1(a) rep(_X,sz(a)){printf("%d ",a[_X]);}puts("");
#define DBG2(a) rep(_X,sz(a)){rep(_Y,sz(a[_X]))printf("%d ",a[_X][_Y]);puts("");}
#define bitcount(b) __builtin_popcount(b)
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)

#define delete(a,n) a.erase(remove(all(a),n),a.end())
template<typename T, typename S> vector<T>& operator<<(vector<T>& a, S b) { a.push_back(b); return a; }
template<typename T> void operator>>(vector<T>& a, int b) {while(b--)if(!a.empty())a.pop_back();}
bool isprime(int n){ if(n<2)return false;  for(int i=2;i*i<=n;i++)if(n%i==0)return false;  return true;} 
ll b_pow(ll x,ll n){return n ? b_pow(x*x,n/2)*(n%2?x:1) : 1ll;}
string itos(int n){stringstream ss;ss << n;return ss.str();}

int x,y,z;
int a[3];
int main(){
	while(cin >> a[0] >> a[1] >> a[2]){
		sort(a,a+3);
		if( a[0]+a[1] <= a[2] ) break;
		if( a[2] * a[2] == a[1] * a[1] + a[0] * a[0] ){
			x++;
		}else if( a[2] * a[2] < a[1] * a[1] + a[0] * a[0] ){
			y++;
		}else{
			z++;
		}
	}
	cout << x+y+z << " " << x << " " << y << " " << z << endl;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int a,b,c,s=0,s1=0,s2=0,s3=0,q;
	while(cin>>a>>b>>c)
	{
		if(a<b)
		{
			q=a;a=b;b=q;
		}
		if(a<c)
		{
			q=a;a=c;c=q;
		}
		if(a>=b+c)break;
		else
		{
			s++;
			if((a*a)==(b*b)+(c*c))s1++;
			else if((a*a)<(b*b)+(c*c))s2++;
			else if((a*a)>(b*b)+(c*c))s3++;
		}
	}
	cout<<s<<" "<<s1<<" "<<s2<<" "<<s3<<endl;
}

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

int main(){
	int a=0,b=0,c=0;
	int e[3];
	while(scanf("%d%d%d", &e[0], &e[1], &e[2]) != EOF){
		sort(e, e+3);
		if(e[2] >= e[1]+e[0]) break;
		if(e[2]*e[2] == e[0]*e[0] +e[1]*e[1]) a++;
		if(e[2]*e[2] < e[0]*e[0] +e[1]*e[1]) b++;
		if(e[2]*e[2] > e[0]*e[0] +e[1]*e[1]) c++;
	}
	printf("%d %d %d %d\n", a+b+c, a, b, c);
	return 0;
}

C++: #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll MOD = 1000000007;

#define vec                vector<int>
#define vecll              vector<ll>
#define vecst              vector<string>
#define vecb               vector<bool>
#define vec2(var, n, m)    vector<vector<int>> var(n, vector<int>(m, 0))
#define vecll2(var, n, m)  vector<vector<ll>> var(n, vector<ll>(m, 0))

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vecst var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());
#define f_sum(var)       accumulate(all(var), 0)
#define f_sumll(var)     accumulate(all(var), 0LL)
#define chmin(v1, v2)    v1 = min(v1, v2)
#define chmax(v1, v2)    v1 = max(v1, v2)
#define mp(v1, v2)       make_pair(v1, v2)
#define pb(var)          push_back(var)
#define prt(var)         cout << (var) << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << var << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << var;
#define prt2(v1, v2)     cout << v1 << " " << v2 << "\n"
#define prt3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << "\n"
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
void prtok(bool ok){prt(ok ? "Yes" : "No");}
//----------------------------------------------------------------
int main(void) {
  ll ans_num=0, ans_0=0, ans_p=0, ans_m=0;
  while(1){
    vec a(3, 0);
    cin >> a[0] >> a[1] >> a[2];
    sortall(a);

    if(a[2]<(a[0]+a[1])){
      ans_num++;
      ll judge=(a[0]*a[0] + a[1]*a[1] - a[2]*a[2]);
      if(judge>0) ans_p++;
      if(judge<0) ans_m++;
      if(judge==0) ans_0++;
    } else {
      cout << ans_num << " " << ans_0 << " " << ans_p << " " << ans_m << "\n";
      return 0;
    }
  }
}

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

int main() {
  vector<int> cnt(3,0);
  while(true) {
    vector<int> v(3);
    cin >> v[0] >> v[1] >> v[2];
    sort(v.begin(),v.end());
    if(v[2] >= v[0]+v[1])
       break;
    if(v[2]*v[2] > v[0]*v[0] + v[1]*v[1])
      cnt[2]++;
    if(v[2]*v[2] == v[0]*v[0] + v[1]*v[1])
      cnt[1]++;
    else
      cnt[0]++;
  }
  cout << cnt[0] + cnt[1] + cnt[2] << " " << cnt[1] << " " << cnt[0] << " " << cnt[2] << endl;
}