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 <bits/stdc++.h>

using namespace std;

int main() {
	int sideInfo[3];
	int total[4];

	memset(total, 0, sizeof(total));
	while (true) {
		cin >> sideInfo[0] >> sideInfo[1] >> sideInfo[2];
		sort(sideInfo, sideInfo + 3);
		if (sideInfo[0] + sideInfo[1] <= sideInfo[2]) {
			break;
		}
		++total[0];
		for (int i = 0; i < 3; ++i) {
			sideInfo[i] *= sideInfo[i];
		}
		if (sideInfo[0] + sideInfo[1] == sideInfo[2]) {
			++total[1];
		}else if (sideInfo[0] + sideInfo[1] > sideInfo[2]) {
			++total[2];
		}
		else {
			++total[3];
		}
	}
	cout << total[0];
	for (int i = 1; i < 4; ++i) {
		cout << " " << total[i];
	}
	cout << endl;

	return 0;
}

C++: #include <stdio.h>
int main(void){
   
  int a,b,c;
  int x;
  int d=0,e=0,t=0;
  
  while( 1 ){
  
    scanf("%d%d%d",&a,&b,&c);
     
    if( a > b ){
      x = a;
      a = b;
      b = x;
    }
    if( b > c ){
      x = b;
      b = c;
      c = x;
    }
    if( a > b ){
      x = a;
      a = b;
      b = x;
    }
     
    if ( c <= b - a || a + b <= c )break;
 
    if( c*c > a*a + b*b ){
      d++;
    }
    if( c*c < a*a + b*b ){
      e++;
    }
    if( c*c == a*a + b*b ){
      t++;
    }
     
  }
  printf("%d %d %d %d\n", d + e + t, t, e, d);
  return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
 
const int INF = 10000000;
const int mod = 1e9 + 7;
const double EPS = 1e-9;


int main(){
	vi v(3,0), ans(3, 0);
	double d;
	int n = 0;
	while(cin>>v[0]>>v[1]>>v[2]){
		sort(all(v));
		d = (double)(v[0]*v[0]+v[1]*v[1]-v[2]*v[2])/(2*v[0]*v[1]);
		if(v[2] >= v[1] + v[0]){
			cout<<n;
			for(int i = 0; i < 3; i++){
				cout<<" "<<ans[i];
			}
			cout<<endl;
			break;
		}
		if(d > 0) ans[1]++;
		else if (d < 0) ans[2]++;
		else ans[0]++;
		n++;
	}
}

C++: #include<stdio.h>
#include<algorithm>
int p[3];
using namespace std;
int main(){
    int a=0,b=0,c=0,d=0;
    while(~scanf("%d%d%d",p,p+1,p+2)){
        std::sort(p,p+3);
        if(p[0]+p[1]<=p[2]){
            printf("%d %d %d %d\n",a,b,c,d);
            return 0;
        }
        a++;
        if(p[0]*p[0]+p[1]*p[1]==p[2]*p[2])b++;
        if(p[0]*p[0]+p[1]*p[1]>p[2]*p[2])c++;
        if(p[0]*p[0]+p[1]*p[1]<p[2]*p[2])d++;
    }
}

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

int main()
{
    int a = 0, b = 0, c = 0;

    while (1) {
        int x, y, z;
        cin >> x >> y >> z;

        if (x < y) swap(x, y);
        if (y < z) swap(y, z);
        if (x < y) swap(x, y);

        if (x >= y + z) break;

        int tmp = x*x - y*y - z*z;
        if (tmp == 0) ++a;
        else if (tmp < 0) ++b;
        else ++c;
    }

    cout << a+b+c << " " << a << " " << b << " " << c << endl;

    return 0;
}

C++: #include <bits/stdc++.h>
#define sqr(x) ((x) * (x))
using namespace std;
int a[3], p, q, r;
int main() {
	ios::sync_with_stdio(false);
	while(cin >> a[0] >> a[1] >> a[2]) {
		sort(a, a + 3);
		if(a[0] + a[1] >= a[2]) break;
		if(sqr(a[0]) + sqr(a[1]) == sqr(a[2])) p++;
		else if(sqr(a[0]) + sqr(a[1]) < sqr(a[2])) q++;
		else r++;
	}
	cout << p + q + r << ' ' << p << ' ' << q << ' ' << r << endl;
	return 0;
}

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

using namespace std;

int main() {
	
	int Length[3];
	int Triangle[4] = {};
	bool flag = 0;
	
	while( scanf("%d %d %d", &Length[0], &Length[1], &Length[2]) != EOF ) {
	
	sort(Length, Length+3);
	
	if( Length[0] + Length[1] <= Length[2] ) 
		flag = 1;
		
	if(flag)
	continue;

	
	Triangle[0]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) == pow(Length[2], 2) )
	Triangle[1]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) < pow(Length[2], 2) )
	Triangle[2]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) > pow(Length[2], 2) )
	Triangle[3]++;
	
	}
	cout << Triangle[0] << " " << Triangle[1] << " "
		<< Triangle[2] << " " << Triangle[3] << "\n";
	return 0;
}

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

C++: #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int main(){
  int a=0,b=0,c=0,d=0;
  int p[3];
  while(~scanf("%d%d%d",p,p+1,p+2)){
    SORT(p,3)
    if(p[0] + p[1] <= p[2]){
      printf("%d %d %d %d\n",a,b,c,d);
      return 0;
     }
     
       a++;
       if(p[0]*p[0] + p[1]*p[1] == p[2] * p[2]) b++;
       if(p[0]*p[0] + p[1]*p[1] > p[2] * p[2]) c++;
       if(p[0]*p[0] + p[1]*p[1] < p[2] * p[2]) d++;
      
  }
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,a) for(int i = 0; i < (a); i++)
#define reps(i, a, b) for(int i = (a); i < (b); i++)
#define INF 1e9
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int, int> pii;
int main() {
	vi v = vi(3,0);
	vi ans = vi(4,0);
	while(cin >> v[0] >> v[1] >> v[2]) {
		sort(v.begin(), v.end());
		int v0 = v[0] * v[0], v1 = v[1] * v[1], v2 = v[2] * v[2];
		if(v[0] + v[1] > v[2]) ans[0]++;
		else break;
		if(v0 + v1 == v2) ans[1]++;
		if(v0 + v1 > v2) ans[2]++;
		if(v0 + v1 < v2) ans[3]++;
	}
	rep(i, 3) printf("%d ", ans[i]);
	printf("%d\n", ans[3]);
	return 0;
}