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(){

    bool holds = true;
    vector<int> mem(4,0);//0が三角形の数　１が直角　２が鋭角　３が鈍角
    vector<int> tri(3);

    while(holds){
        vector<int> node(3);
        int a,b,c;
        cin>>node[0]>>node[1]>>node[2];

        for(int i=0;i<3;i++){
            if(node[i] >= node[(i+1)%3] + node[(i+2)%3]){
                holds = false;
            }
            else {
               sort(node.begin(),node.end());
               a = node[2];
               b = node[1];
               c = node[0];
            }
        }

        if(holds){
            mem[0]++;
            if(a*a > b*b + c*c) mem[3]++;
            else if (a*a < b*b + c*c) mem[2]++;
            else mem[1]++;
        }
    }
    for(int i=0;i<3;i++){
        cout<<mem[i]<<" ";
    }
    cout<<mem[3]<<endl;
}

C++: #include<iostream>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int a,b,c;
	long long sharp=0,Dull=0,Ra=0;
	while(1){
		cin>>a>>b>>c;
		if(a+b<=c || b+c<=a || c+a<=b)break;
		int maxnum=max(max(a,b),c);
		if(maxnum==a){
			if(a*a==b*b+c*c)Ra++;
			else if(a*a>b*b+c*c)Dull++;
			else sharp++;
		}else if(maxnum==b){
			if(b*b==c*c+a*a)Ra++;
			else if(b*b>c*c+a*a)Dull++;
			else sharp++;
		}else{
			if(c*c==a*a+b*b)Ra++;
			else if(c*c>a*a+b*b)Dull++;
			else sharp++;
		}
	}
	cout<<sharp+Dull+Ra<<" "<<Ra<<" "<<sharp<<" "<<Dull<<endl;
	return 0;
}

C++: #include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1000000000
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};

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


/*
14
1 0
1 1
1 2
2 1
0 0
0 1
0 2
0 3
3 3
4
5
6
7
8
*/

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

int main(){
	int length[3];
	int w = 0, x = 0, y = 0, z = 0;

	while(cin >> length[0] >> length[1] >> length[2]){
		sort(length, length+3);

		if(length[2] < length[0] + length[1]){
			w++;
			if(pow(length[2], 2) == pow(length[0], 2) + pow(length[1], 2)) y++;
			else if(pow(length[2], 2) < pow(length[0], 2) + pow(length[1], 2)) z++;
			else x++;
		}
		else {
			cout << w << ' ' << y << ' ' << z << ' ' << x << endl;
		}
	}

}

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

using namespace std;

int main() {
	
	int L[3];
	int T[4] = {0};
	bool f = 0;
	
	while( cin >> L[0] >> L[1] >> L[2]) {
	
	sort(L, L+3);
	
	if( L[0] + L[1] <= L[2] ) f = 1;
	if(f) continue;
	
	if( L[0] * L[0] + L[1] * L[1] 
	== L[2] * L[2] )
	T[1]++;
	
	else if(L[0] * L[0] + L[1] * L[1] 
	> L[2] * L[2] )
	T[2]++;
	
	else
	T[3]++;
	
	T[0]++;
	}

	cout << T[0] << " " << T[1] << " " << T[2] << " " << T[3] << "\n";
	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])y++;
			else if (a[0] * a[0] + a[1] * a[1] <= a[2] * a[2])z++;
			else if (a[0] * a[0] + a[1] * a[1] >= a[2] * a[2])x++;
		}
	}
	cout << t << ' ' << x << ' ' << y << ' ' << z << endl;
}

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];
      }
      cout << endl;
      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]++;

  }
}