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;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://onlinejudge.u-aizu.ac.jp/challenges/sources/JOI/Prelim/0582?year=2006>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    vector<ll> ans(4);
    
    ll a,b,c;
    while(cin >> a >> b >> c){
        vector<ll> abc = {a,b,c};
        sort(abc.rbegin(),abc.rend());
        a = abc[0]; b = abc[1]; c = abc[2];
        
        if(b+c>a){
            ans[0]++;
            
            if(a*a == b*b+c*c){
                ans[1]++;
            }else if(a*a > b*b + c*c){
                ans[3]++;
            }else{
                ans[2]++;
            }
        }else{
            cout << ans << endl;
            break;
        }
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    solve(0);
    // cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}

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

int main(){
	int a=0,b=0,c=0;
	int e[3];
	while(scanf("%d%d%d", &e[0], &e[1], &e[2]) != EOF){
		sort(e, e+3);
		if(e[2] >= e[1]+e[0]) continue;
		if(e[2]*e[2] == e[0]*e[0] +e[1]*e[1]) a++;
		if(e[2]*e[2] < e[0]*e[0] +e[1]*e[1]) b++;
		if(e[2]*e[2] > e[0]*e[0] +e[1]*e[1]) c++;
	}
	printf("%d %d %d %d\n", a+b+c, a, b, c);
	return 0;
}

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

#define SIDE side[0] + side[1] - side[2]

using namespace std;

int main()
{
	int side[3];
	int count[4] = {0};
	
	while (1){
		for (int i = 0; i < 3; i++){
			cin >> side[i];
		}
		sort(side, side + 3);
		if (0 >= SIDE){
			break;
		}
		
		for (int i = 0; i < 3; i++){
			side[i] *= side[i];
		}
		if (SIDE == 0){
			count[1]++;
		}
		else if (0 < SIDE){
			count[2]++;
		}
		else if (0 > SIDE){
			count[3]++;
		}
		count[0]++;
	}
	
	for (int i = 0; i < 3; i++){
		cout << count[i] << ' ';
	}
	cout << count[3] << endl;
}

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

int main(){
	int a[3];
	int x=0,y=0,z=0;
	while(true){
		scanf("%d%d%d",&a[0],&a[1],&a[2]);
		sort(a,a+3);
		if(a[0]+a[1] <= a[2]){
			break;
		}
		int tmp = a[0]*a[0]+a[1]*a[1];
		int tmp2 = a[2]*a[2];
		if(tmp == tmp2){
			x++;
		}
		else if(tmp < tmp2){
			z++;
		}
		else{
			y++;
		}
	}
	printf("%d %d %d %d\n",x+y+z,x,y,z);
	return 0;
}

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

using namespace std;
int a[3], total, les, righ, more;
int main(){
    while(cin){
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);
	if(a[2] >= a[0] + a[1] || a[2] <= a[1] - a[0]){
	    cout << total << " " << righ << " " << more << " " << les << endl;
	    return 0;
	}
	int p = a[2] * a[2];
	int q = a[1] * a[1] + a[0] * a[0];
	if(p > q)les++;
	if(p == q)righ++;
	if(p < q)more++;
	total++;
    }
}

C++: #include <iostream>
#include <algorithm>
 
using namespace std;
 
int main() {
 
  int a[3];
  bool flg = 0;
  int ans[4] ={0};
  while(cin >>a[0] >> a[1] >> a[2]) {
    
    sort(a,a+3);
 
    if(a[0]+a[1] <= a[2] ) flg = 1;
    if(flg == 1) continue;
 
     
    if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]) ans[0]++;
    else if(a[0]*a[0]+a[1]*a[1] < a[2]*a[2]) ans[1]++;
    else ans[2]++;
 
    ans[3]++;
 
  }
 
  cout <<ans[3]<<" "<<ans[0]<<" "<<ans[2]<<" "<< ans[1]<<endl;
  return 0;
}

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

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

  while(cin >> a >> b >> c){
    if(a + b <= c || a + c <= b || b + c <= a){
      break;
    }

    a *= a;
    b *= b;
    c *= c;

    if(a + b == c || a + c == b || b + c == a){
      x++;
    }
    else if(abs(a - b) < c && c < a + b ||
            abs(a - c) < b && b < a + c ||
            abs(b - c) < a && a < b + c){
      y++;
    }
    else{
      z++;
    }
  }

  cout << x + y + z << " " << x << " " << y << " " << z << endl;
}

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

using namespace std;
int main()
{
    int a[3];
    int cnt=0;
    int cnt1=0;
    int cnt2=0;
    int cnt3=0;
    while(1){
        cin >> a[0] >> a[1] >> a[2];
        sort(a,a+3);
        int min=a[0];
        int max1=a[2];
        int max2=a[1];
        if(abs(max2-max1)>=min||min>=max1+max2){
            break;
        }
        cnt++;
        if(min*min+max2*max2-max1*max1==0){
            cnt1++;
        }else if(min*min+max2*max2-max1*max1>0){
            cnt2++;
        }else{
            cnt3++;
        }
        
    }

    cout << cnt << " " << cnt1 << " " << cnt2 << " " << cnt3 << endl;
    return 0;
}