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>
#include <cmath>
#define _USE_MATH_DEFINES
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 <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define rep2(i, s, n) for (int i = s; i < (int)n; i++)
#define all(obj) obj.begin(), obj.end()
#define debug(x) cerr << #x << ":" << x << "\n"
#define vdebug(vec) cerr << #vec << ":"; for (auto e : vec) cerr << e << " "; cout << "\n"
#define YN(f) cout << (f ? "YES" : "NO") << endl
#define Yn(f) cout << (f ? "Yes" : "No") << endl
#define yn(f) cout << (f ? "yes" : "no") << endl
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

int main () {
	int a, b, c;
	int ac = 0, rt = 0, ob = 0;
	while (true) {
		cin >> a >> b >> c;
		if (a == 0 && b == 0 && c == 0) break;
		if (a > b) swap(a, b);
		if (b > c) swap(b, c);
		if (c >= a + b) {
			cout << ac + rt + ob << " " << rt << " " << ac << " " << ob << endl;
			break;
		} else {
			int x = a * a + b * b - c * c;
			if (x > 0) ac++;
			else if (x == 0) rt++;
			else if (x < 0) ob++;
		}
	}
}

C++: /**
 * File    : JOI_2005_triangle_types.cpp
 * Author  : Kazune Takahashi
 * Created : 2018-3-8 21:20:52
 * Powered by Visual Studio Code
 */

#include <iostream>
#include <iomanip>   // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to_string(nnn) // substr(m, n) // stoi(nnn)
#include <complex>
#include <tuple>
#include <queue>
#include <stack>
#include <map> // if (M.find(key) != M.end()) { }
#include <set>
#include <random> // random_device rd; mt19937 mt(rd());
#include <cctype>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;

#define DEBUG 0 // change 0 -> 1 if we need debug.

typedef long long ll;

// const int dx[4] = {1, 0, -1, 0};
// const int dy[4] = {0, 1, 0, -1};

// const int C = 1e6+10;
// const ll M = 1000000007;

int cnt[3] = {0, 0, 0};

int main()
{
  int a[3];
  while (cin >> a[0] >> a[1] >> a[2])
  {
    sort(a, a + 3);
    if (a[0] + a[1] <= a[2])
    {
      cout << cnt[0] + cnt[1] + cnt[2] << " "
           << cnt[0] << " " << cnt[1] << " " << cnt[2] << endl;
      return 0;
    }
    int s = a[0] * a[0] + a[1] * a[1];
    int t = a[2] * a[2];
    if (s < t)
    {
      cnt[2]++;
    }
    else if (s == t)
    {
      cnt[1]++;
    }
    else
    {
      cnt[0]++;
    }
  }
}

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

main()
{
  double a, b, c;
  int chokaku = 0, eikaku = 0, donkaku = 0;
  
  while(1){
    scanf("%lf %lf %lf", &a, &b, &c);
    if ( a + b > c && a + c > b && b + c > a ) {
      if ( a*a + b*b == c*c || a*a + c*c == b*b || b*b + c*c == a*a) {
	chokaku++;
      } else if ( asin(a/b) < M_PI / 2. && asin(a/c) < M_PI / 2. && asin(b/c) < M_PI / 2) {
	eikaku++;
      } else {
	donkaku++;
      }
    } else {
      break;
    }
  }
  
  printf("%d %d %d %d\n", eikaku+donkaku+chokaku, chokaku, donkaku, eikaku);
  
  return (0);
}

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

using namespace std;

int main() {
	
	int Length[3];
	int Triangle[4] = {0};
	bool flag = 0;
	
	while( cin >> Length[0] >> Length[1] >> Length[2]) {
	
	sort(Length, Length+3);
	
	if( Length[0] + Length[1] <= Length[2] ) flag = 1;
	if(flag == 1) continue;
	
	if( Length[0] * Length[0] + Length[1] * Length[1] 
	== Length[3] * Length[3] )
	Triangle[1]++;
	
	else if(Length[0] * Length[0] + Length[1] * Length[1] 
	< Length[3] * Length[3] )
	Triangle[2]++;
	
	else
	Triangle[3]++;
	
	}
	Triangle[0] += ( Triangle[1] + Triangle[2] + Triangle[3] );
	cout << Triangle[0] << " " << Triangle[1] << " "
		 << Triangle[2] << " " << Triangle[3] << "\n";
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define first F
#define second S

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  vi l(3);
  vi n(4,0);
  while(scanf("%d %d %d",&l[0],&l[1],&l[2])!=EOF){
    sort(all(l));
    if(l[0]+l[1]>l[2])n[0]++;
    else continue;
    double cosine=double(l[0]*l[0]+l[1]*l[1]-l[2]*l[2])/(2*l[0]*l[1]);
    if(cosine==0)n[1]++;
    else if(cosine>0)n[2]++;
    else if(cosine<0)n[3]++;
  }
  printf("%d %d %d %d\n",n[0],n[1],n[2],n[3]);
}

C++: // 2014/06/26 Tazoe

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	int cnt0 = 0;
	int cnt1 = 0;
	int cnt2 = 0;
	int cnt3 = 0;

	while(true){
		int a, b, c;
		cin >> a >> b >> c;

		if(a<b){
			swap(a, b);
		}
		if(a<c){
			swap(a, c);
		}

		if(a>=b+c){
			cout << cnt0 << ' ' << cnt1 << ' ' << cnt2 << ' ' << cnt3 << endl;
			break;
		}

		cnt0++;

		if(a*a==b*b+c*c){
			cnt1++;
		}
		else if(a*a<b*b+c*c){
			cnt2++;
		}
		else{
			cnt3++;
		}
	}

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
	int a[3],b,c,d,e;
	b=c=d=e=0;
	while(scanf("%d %d %d",&a[0],&a[1],&a[2])!=EOF){
		sort(a,a+3);
		if(a[0]+a[1]<=a[2]){
				cout << b << " " << c << " " << d << " " << e << endl;
				return 0;
		}
		b++;
		if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])	c++;
		if(a[0]*a[0]+a[1]*a[1]>a[2]*a[2])	d++;
		if(a[0]*a[0]+a[1]*a[1]<a[2]*a[2])	e++;
	}
}