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++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;

signed main() {
	vector<int>v(3, 0);
	int sankaku(0), chokkaku(0), eikaku(0), donkaku(0);
	while (cin >> v[0] >> v[1] >> v[2]) {
		sort(all(v));
		if (v[0] + v[1] > v[2]) {
			sankaku++;
			if (v[0] * v[0] + v[1] * v[1] == v[2] * v[2])chokkaku++;
			else if (v[0] * v[0] + v[1] * v[1] < v[2] * v[2])donkaku++;
			else eikaku++;
		}
	}
	cout << sankaku << " " << chokkaku << " " << eikaku << " " << donkaku << endl;
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a[3];
	int t = 0, x = 0, y = 0, z = 0;
	bool b = true;
	while (cin >> a[0] >> a[1] >> a[2]){
		if (!b)continue;
		sort(a, a + 3);
		if (a[0] + a[1] <= a[2]){
			b = false;
			continue;
		}
		else{
			t++;
			if (a[0] * a[0] + a[1] * a[1] <= a[2] * a[2])
				x++;
			else if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2])
				y++;
			else if (a[0] * a[0] + a[1] * a[1] >= a[2] * a[2])
				z++;
		}
	}
	cout << t << ' ' << x << ' ' << y << ' ' << z << endl;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
 
const int INF = 10000000;
const int mod = 1e9 + 7;
const double EPS = 1e-9;


int main(){
	vi v(3,0), ans(3, 0);
	double d;
	int n = 0;
	while(cin>>v[0]>>v[1]>>v[2]){
		sort(all(v));
		d = (double)(v[0]*v[0]+v[1]*v[1]-v[2]*v[2])/(2*v[0]*v[1]);
		if(v[2] >= v[1] + v[0]){
			cout<<n;
			for(int i = 0; i < 3; i++){
				cout<<" "<<ans[i];
			}
			cout<<endl;
			break;
		}
		if(d > 0) ans[0]++;
		else if (d < 0) ans[1]++;
		else ans[2]++;
		n++;
	}
}

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

const double EPS = 1e-8;

int main(){
  int v[3],ans[3],ansn=0;
  bool f = false;
  fill(ans,ans+3,0);
  while(cin >> v[0] >> v[1] >> v[2]){
    if(f) continue;
    sort(v,v+3);
    if(v[2] >= v[1] + v[0]){
      cout << ansn;
      for(int i=0;i<3;i++) cout << ' ' << ans[i];
      cout << endl;
      f = true;
    } else {
      double w[3];
      for(int i=0;i<3;i++) w[i] = (double)v[i];
      double a = (w[0]*w[0] + w[1]*w[1] - w[2]*w[2]) / (2 * w[0] * w[1]);

      ansn++;
      if(a > EPS) ans[1]++;
      else if(a < -EPS) ans[2]++;
      else ans[0]++;
    }
  }
}

C++: #include<iostream>
using namespace std;
int main(){

	int i,k,j,a=0,b=0,c=0,d=0;
while(1){
	cin>>i>>k>>j;
	if(i>j){swap(i,j);}
	if(k>j){swap(k,j);}

	if(i+k>j&&k+j>i&&i+j>k){a=a+1;}
	else{break;}

	if(i*i+k*k>j*j){b=b+1;}
	if(i*i+k*k<j*j){c=c+1;}
	if(i*i+k*k==j*j){d=d+1;}

}
    cout<<a<<" "<<d<<" "<<b<<" "<<c<<endl;

	return 0;
}

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

int a[3], c[3];

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

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


bool sankaku(int a, int b, int c) {
    int max_ = a;
    if (max_ < b) {
        max_ = b;
    }
    if (max_ < c) {
        max_ = c;
    }
    if (a + b + c - max_ > max_) {
        return true;
    }
    else {
        return false;
    }
}


int nani_sankaku(int a, int b, int c) {
    int hen[3] = {a, b, c};
    sort(hen, hen + 3);
    double ab = sqrt(pow(a, 2) + pow(b, 2));
    double c_ = pow(c, 2);
    if (ab > c) {
        return 0;
    }
    if (ab == c) {
        return 1;
    }
    if (ab < c) {
        return 2;
    }

}


int main() {
    int ANS[3] = {0, 0, 0};
    while (true) {
        int a;
        int b;
        int c;
        cin >> a >> b >> c;

        if (sankaku(a, b, c)) {
            ANS[nani_sankaku(a, b, c)]++;
        }
        else {
            cout << ANS[0] << ' ' << ANS[1] << ' ' << ANS[2] << '\n';
            return 0;
        }
    }
}

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

int main() {
	int a, b, c;
	int tri = 0;
	int acte = 0;
	int right = 0;
	int obtuse = 0;
	vector<int> t(3);
	while (cin >> a >> b >> c) {
		t[0] = a;
		t[1] = b;
		t[2] = c;
		sort(t.begin(), t.end());
		a = pow(t[0], 2);
		b = pow(t[1], 2);
		c = pow(t[2], 2);
		if (t[0] + t[1] > t[2]) {
			tri++;
			if (a + b == c) {
				right++;
			}
			else if (a + b > c){
				acte++;
			}
			else if (a + b < c) {
				obtuse++;
			}
		}
	}
	cout << tri << " " << right << " " << acte << " " << obtuse << endl;
	return 0;
}

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

using namespace std;

/*
三角形：最大の辺 < その他の辺の和
鋭角三角形：最大の辺の二乗 < 最小の辺の二乗＋中間の辺の二乗
直角三角形：最大の辺の二乗 = 最小の辺の二乗＋中間の辺の二乗
鈍角三角形：最大の辺の二乗 > 最小の辺の二乗＋中間の辺の二乗
*/

int main() {
	int a[3];
	int Triangle = 0;
	int eikaku = 0;
	int chokkaku = 0;
	int donkaku = 0;

	while (true) {
		cin >> a[0] >> a[1] >> a[2];
		sort(begin(a), end(a));
		// 三角判定
		if (a[2] < a[1] + a[0]) {
			Triangle++;
			const int a0_sq = a[0] * a[0];
			const int a1_sq = a[1] * a[1];
			const int a2_sq = a[2] * a[2];
			//鋭角判定
			if (a2_sq < a1_sq + a0_sq) {
				eikaku++;
			}
			//直角判定
			else if(a2_sq == a1_sq + a0_sq) {
				chokkaku++;
			}
			else {
				donkaku++;
			}
		}
		else {
			break;
		}
	}

	cout << Triangle << ' ' << chokkaku << ' ' << eikaku << ' ' << donkaku << endl;

	return 0;
}

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

const double EPS = 1e-8;

int main(){
  int v[3],ans[3],ansn=0;
  bool f = false;
  fill(ans,ans+3,0);
  while(cin >> v[0] >> v[1] >> v[2]){
    if(f) continue;
    sort(v,v+3);
    if(v[2] >= v[1] + v[0]){
      cout << ansn;
      for(int i=0;i<3;i++) cout <<  ans[i];
      cout << endl;
      f = true;
    } else {
      double w[3];
      for(int i=0;i<3;i++) w[i] = (double)v[i];
      double a = (w[0]*w[0] + w[1]*w[1] - w[2]*w[2]) / (2 * w[0] * w[1]);

      ansn++;
      if(a > EPS) ans[1]++;
      else if(a < -EPS) ans[2]++;
      else ans[0]++;
    }
  }
}