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 <bits/stdc++.h>
using namespace std;

using pii = pair<int, int>;
using vi = vector<int>;
using ll = long long;

int main() {
    int x = 0, y = 0, z = 0;
    int a, b, c;
    while(cin >> a >> b >> c) {
        int a1 = min({a, b, c}), a3 = max({a, b, c}), a2 = a + b + c - a1 - a3;
        if(a1 + a2 <= a3) {
            break;
        }
        if(a1 * a1 + a2 * a2 == a3 * a3) {
            x += 1;
        } else if(a1 * a1 + a2 * a2 > a3 * a3) {
            y += 1;
        } else {
            z += 1;
        }
    }
    cout << x + y + z << ' ' << x << ' ' << y << ' ' << z << endl;
}

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

int main(){
	vector<int> a(3), ans(4, 0);
	while( cin >> a[0] >> a[1] >> a[2] ){
		sort(a.begin(), a.end());
		double cosX = (double) (a[0] * a[0] + a[1] * a[1] - a[2] * a[2]) / 2.0 * a[0] * a[1];
		 
		if( a[0] + a[1] <= a[2] ){ // 三角形でない
			cout << ans[0] << " " << ans[1] << " " << ans[2] << " " << ans[3] << endl;
			return 0;
		}else if( a[0] * a[0] + a[1] * a[1] == a[2] * a[2] ){ // 直角三角形
			ans[1]++;
		}else if( cosX <= 0 ){ // 鈍角三角形
			ans[3]++;
		}else{ // 鋭角三角形
			ans[2]++;
		}
		ans[0]++;
	}
}

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

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

const int    INF = 1000000000;
const ll     MOD = 1000000007LL;
const double EPS = 1E-12;

template<typename T> ostream& operator <<(ostream& r, const vector<T> t){vrep(v,t)r<<*v<<(v+1==t.end()?"":" ");return r;}
template<typename T> ostream& operator <<(ostream& r, const pair<vector<T>, int> p){int n=p.second;minup(n,p.first.size());rep(i,n-1)r<<p.first[i]<<' ';r<<p.first[n-1];return r;}
template<typename T> ostream& operator <<(ostream& r, const pair<T*, int> p){int n=p.second-1;rep(i,n)r<<p.first[i]<<' ';return r<<p.first[n];}
template<typename T, size_t S> ostream& operator <<(ostream& r, const T (&a)[S]){rep(i,S-1)r<<a[i]<<' ';return r<<a[S-1];}


int l[3];
int res[4];

int main()
{
  while(cin >> l[0] >> l[1] >> l[2]){
    sort(l, l+3);
    if(l[0] + l[1] <= l[2]){
      cout << res << endl;
      break;
    }
    int s = l[0] * l[0] + l[1] * l[1];
    int t = l[2] * l[2];
    res[0] += 1;
    if(s == t) res[1] += 1;
    if(s  > t) res[2] += 1;
    if(s  < t) res[3] += 1;
  }

  return 0;
}

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

using namespace std;

// Checks the sides satisfies the triangle inequality.
inline bool Ok(int a, int b, int c) {
  return a < b + c && b < a + c && c < a + b;
}

int main() {
  size_t i = 0;
  size_t obtuse = 0;
  size_t acute = 0;
  size_t right = 0;

  int a, b, c;
  for (;;) {
    cin >> a >> b >> c;
    if (!Ok(a, b, c)) {
      printf("%lu %lu %lu %lu\n", i, right, acute, obtuse);
      break;
    }
    const auto m = max({a, b, c});
    int lhs = 0;
    int rhs = 0;
    if (m == a) {
      lhs = a * a;
      rhs = b * b + c * c;
    } else if (m == b) {
      lhs = b * b;
      rhs = a * a + c * c;
    } else { // m == c
      lhs = c * c;
      rhs = a * a + b * b;
    }
    if (lhs == rhs) {
      ++right;
    } else if (lhs < rhs) {
      ++acute;
    } else {
      ++obtuse;
    }

    ++i;
  }

  return 0;
}

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

int out[4] = {0};

int main() {
int l[3];
while( cin >> l[0] >> l[1] >> l[2] ) {
sort(l, l+3);
if ( l[2] > l[0] + l[1] )
break;

out[0]++;
if ( l[2] * l[2] == l[0] * l[0] + l[1] * l[1] )
out[1]++;
if ( l[2] * l[2] < l[0] * l[0] + l[1] * l[1] )
out[2]++;
if ( l[2] * l[2] > l[0] * l[0] + l[1] * l[1] )
out[3]++;
}

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

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

int main() {
	
	int e = 0, t = 0, d = 0, all = 0;
	
	while (1) {
		int i, j, k;
		cin >> i >> j >> k;
		if (i < j && k < j) {
			int temp = i;
			i = j;
			j = temp;
		}
		else if (i <k && j < k) {
			int temp = i;
			i = k;
			k = temp;
		}
		
		if (j + k <= i) break;
		int ii = i * i, jj = j * j, kk = k*k;
		if (ii == jj + kk) t++;
		else if (ii < jj + kk) e++;
		else d++;
		all++;
	}
	
	cout << all << " " << t << " " << e << " " << d << "\n";
	
	return 0;
}

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

int main()
{
  int a[3];
  int n, x, y, z;

  x = y = z = n = 0;
  while (cin >> a[0] >> a[1] >> a[2]){
    sort(a, a + 3);
    int s = a[0];
    int d = a[1];
    int f = a[2];

    if (s + d <= f){
      cout << n << " " << x << " "<< y << " "<< z << endl;
      return 0;
    }
    n++;

    if (s * s + d * d == f * f){
      x++;
    }
    if (s * s + d * d > f * f){
      y++;
    }
    if (s * s + d * d < f * f){
      z++;
    }
  }

  cout << n << " " << x << " " << y << " " << z << endl;

  return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<map>
#include<complex>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int main(){
  vector<int>ve(3);
  bool flag=false;
  int ans[4]={};
  while(cin>>ve[0]>>ve[1]>>ve[2]){
    if(flag)continue;
    sort(ve.begin(),ve.end(),greater<int>());
    if(ve[0]>=ve[1]+ve[2]){
      flag=true;
      continue;
    }
    if((ve[0]*ve[0])==(ve[1]*ve[1]+ve[2]*ve[2])){
      ans[0]++;
      ans[1]++;
    }else if(ve[0]*ve[0]<ve[1]*ve[1]+ve[2]*ve[2]){
      ans[0]++;
      ans[2]++;
    }else{
      ans[0]++;
      ans[3]++;
    }
    //cout<<ans[0]<<" "<<ans[1]<<" "<<ans[2]<<" "<<ans[3]<<endl;
  }
  cout<<ans[0]<<" "<<ans[1]<<" "<<ans[2]<<" "<<ans[3]<<endl;
  return 0;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;

int main(){
    int inp[3], tyoku = 0, don = 0, ei = 0;
    for (int i = 0; i < 5; i++){
        scanf("%d %d %d",&inp[0], &inp[1], &inp[2]);
        sort(inp, inp + 3);
        
        if(inp[0] + inp[1] > inp[2]){
            int p = inp[0]*inp[0] + inp[1]*inp[1];
            int q = inp[2]*inp[2];
            if(p == q) tyoku++;
            else if(p < q) don++;
            else ei++;
        }
    }
    
    printf("%d %d %d %d¥n", tyoku +don +ei, tyoku,ei,don);
    return 0;
}