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 <iostream>
using namespace std;

int main() {
        int a, b, c, ab, cc;
        int i, j, x;
        int ai=0, dn=0, tk=0, sa=0;

        while(1) {
                cin >> a >> b >> c;
                if (a > b) {
                        x = b;
                        b = a;
                        a = x;
                }
                if (b > c) {
                        x = c;
                        c = b;
                        b = x;
                }
                if ((a + b) <= c) {
                        break;
                }
                sa++;
                ab = (a * a) + (b * b);
                cc = c * c;
                if (ab == cc) {
                        tk++;
                } else {
                        if (ab > cc) ai++;
                        if (ab < cc) dn++;
                }
        }
        cout << sa << " " << tk << " " << ai << " " << dn << endl;
        return 0;
}

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]);
}