Go: package main

import (
	"fmt"
	"sort"
)

// TriangleKind kind of triangle
type TriangleKind int

const (
	// Nothing not triangle
	Nothing TriangleKind = iota
	// RightTriangle the right triangle
	RightTriangle
	// SharpTriangle the sharp triangle
	SharpTriangle
	// ObtuseTriangle the obtuse triangle
	ObtuseTriangle
) // const for Triangle kind

type result struct {
	rTriangle int
	sTriangle int
	oTriangle int
}

func (res *result) String() string {
	return fmt.Sprintf("%d %d %d %d", res.rTriangle+res.sTriangle+res.oTriangle, res.rTriangle, res.sTriangle, res.oTriangle)
}

func checkTriangleType(a int, b int, c int) TriangleKind {
	p := []int{a, b, c}
	sort.Sort(sort.IntSlice(p))
	if !(p[0]+p[1] > p[2] && p[1]+p[2] > p[0] && p[2]+p[0] > p[1]) {
		return Nothing
	}

	c = (p[0] * p[0]) + (p[1] * p[1]) - (p[2] * p[2])
	if c == 0 {
		return RightTriangle
	}
	if c > 0 {
		return SharpTriangle
	}
	return ObtuseTriangle
}

func main() {
	var res = new(result)
	var a, b, c int
	var hasNext = true
	for hasNext {
		fmt.Scanf("%d %d %d", &a, &b, &c)
		switch checkTriangleType(a, b, c) {
		case Nothing:
			hasNext = false
		case RightTriangle:
			res.rTriangle++
		case SharpTriangle:
			res.sTriangle++
		case ObtuseTriangle:
			res.oTriangle++
		}
	}
	fmt.Println(res.String())
}

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]++;

  }
}