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 <algorithm>
#include <array>
#include <iostream>

using namespace std;

namespace prob0582 {
	enum TriangleType { DoesNotExist = 0, RightAngle, Accute, Obtuse };

	TriangleType checkTriangleType(array<int, 3> edges)
	{
		int longest = 0;
		int longest2sq = 0;
		int sum = 0;
		int sumsq = 0;

		for (int i = 0; i < 3; ++i) {
			if (edges[i] > longest) longest = edges[i];
			sum += edges[i];
			sumsq += edges[i] * edges[i];
		}
		longest2sq = 2 * longest * longest;

		if (sum <= 2 * longest) return DoesNotExist;
		if (sumsq > longest2sq) return Accute;
		if (sumsq == longest2sq) return RightAngle;
		return Obtuse;
	}

	void solve(istream &sin, ostream &sout)
	{
		int total = 0;
		int eachType[]{ 0,0,0,0 };

		array<int, 3> edges;
		TriangleType type;

		do
		{
			sin >> edges[0] >> edges[1] >> edges[2];
			++total;
			type = checkTriangleType(edges);
			eachType[static_cast<int>(type)]++;
		} while (type != DoesNotExist);
		--total;

		sout << total;
		for (int i = 0; i < 3; ++i) sout << " " << eachType[i + 1];
		sout << endl;
	}
}

int main()
{
	prob0582::solve(cin, cout);
}

C++: #include "bits/stdc++.h"

using namespace std;

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

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

#define EPS 1e-8

int main(){
    int a=0,b=0,c=0,d=0;
    int x,y,z;
    while(cin>>x>>y>>z){
        vi in;
        in.pb(x);
        in.pb(y);
        in.pb(z);
        sort(all(in));
        
        if(in[0]+in[1]<=in[2]){
            cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
            while(cin>>x>>y>>z);
            break;
        }
        else a++;
        
        double l,m,n;
        l = acos( (-1*in[0]*in[0] + in[1]*in[1] + in[2]*in[2])/(2.0*in[1]*in[2]) );
        m = acos( (-1*in[1]*in[1] + in[2]*in[2] + in[0]*in[0])/(2.0*in[2]*in[0]) );
        n = acos( (-1*in[2]*in[2] + in[0]*in[0] + in[1]*in[1])/(2.0*in[0]*in[1]) );
        
        l=l*180/3.141592;
        m=m*180/3.141592;
        n=n*180/3.141592;

        
        if( (l-90)*(l-90)<EPS || (m-90)*(m-90)<EPS || (n-90)*(n-90)<EPS ){
            b++;
        }
        else if( l>90-EPS || m>90-EPS || n>90-EPS ){
            d++;
        }
        else c++;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int ttl=0,cho=0,eik=0,don=0;
    while(true){
        vi a(3);for(int i=0;i<3;i++)cin>>a[i];
        sort(a.begin(),a.end());
        if(a[0]+a[1]<=a[2]){
            printf("%d %d %d %d\n",ttl,cho,eik,don);
            return 0;
        }
        ttl++;
        if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])cho++;
        else if(a[0]*a[0]+a[1]*a[1]>a[2]*a[2])eik++;
        else don++;
    }
    return 0;
}

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

int main()
{	
	int a[3];
	int t[4] = { 0, 0, 0, 0 };

	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);

	while (a[0] + a[1] > a[2]) {
		t[0]++;

		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2])
			t[1]++;
		else if (a[0] * a[0] + a[1] * a[1] > a[2] * a[2])
			t[2]++;
		else
			t[3]++;

		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
	}

	cout << t[0] << " " << t[1] << " " << t[2] << " " << t[3] << endl;

	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a[3];
	bool b = true;
	int w, x, y, z;
	while (cin){
		if (b) {
			w++;
			sort(a, a + 3);
			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 z++;
		}
	}
	cout << w << ' ' << x << ' ' << y << ' ' << z << endl;
}

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

int main(){
  int hen[3];
  int cnt=0;
  int d=0;
  int e=0;
  
  while(1)
    {
      for(int i=0;i < 3;i++)
	{
	  cin >> hen[i];
	}
      sort(hen,hen+3);

      int judge = pow(hen[0],2) + pow(hen[1],2);
      int most = pow(hen[2],2);
      
      if(hen[0]+hen[1] > hen[2] && hen[1]+hen[2] > hen[0] && hen[2]+hen[0] > hen[1])
	{
	  if(judge < most)
	    {
	      d++;
	    }
	  else if(judge > most)
	    {
	      e++;
	    }
	  else if(judge == most)
	    {
	      cnt++;
	    }
	}
      else
	{
	  break;
	}
    }
  cout << cnt+d+e << " " << cnt << " " << d << " " << e << endl;
  return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a=0,b=0,c=0,d=0;
	int e[3];
	while(cin >> e[0] >> e[1] >> e[2]){
		sort(e,e+3);
		if(e[0]+e[1]>e[2]){
			++a;
			for(int i=0; i<3; ++i)	e[i]*=e[i];
			if(e[0]+e[1]==e[2])	++b;
			else if(e[0]+e[1]>e[2])	++c;
			else	++d;
		}else	break;
	}
	cout << a << " " << b << " " << c << " " << d << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>

#define LP(i,n) for(int i=0;i<n;i++)
#define Mset(x,v) memset(x,v,sizeof(x))
#define INF INT_MAX

using namespace std;
using LL=long long;

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

C++: #include "bits/stdc++.h"

using namespace std;

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

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

#define EPS 1e-8

int main(){
    int a,b,c,d;
    int x,y,z;
    while(cin>>x>>y>>z){
        vi in;
        in.pb(x);
        in.pb(y);
        in.pb(z);
        sort(all(in));
        
        if(in[0]+in[1]<=in[2]){
            cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
            break;
        }
        else a++;
        
        double l,m,n;
        l = acos( (-1*in[0]*in[0] + in[1]*in[1] + in[2]*in[2])/(2.0*in[1]*in[2]) );
        m = acos( (-1*in[1]*in[1] + in[2]*in[2] + in[0]*in[0])/(2.0*in[2]*in[0]) );
        n = acos( (-1*in[2]*in[2] + in[0]*in[0] + in[1]*in[1])/(2.0*in[0]*in[1]) );
        
        l=l*180/3.141592;
        m=m*180/3.141592;
        n=n*180/3.141592;

        
        if( (l-90)*(l-90)<EPS || (m-90)*(m-90)<EPS || (n-90)*(n-90)<EPS ){
            b++;
        }
        else if( l>90-EPS || m>90-EPS || n>90-EPS ){
            d++;
        }
        else c++;
    }
}