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;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
using ll = long long;
using P = pair<int, int>;
using namespace std;

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    vector<double> abc(3);
    ll ans1=0, ans2=0, ans3=0, ans4=0;
    while (true) {
        rep(i, 3) cin >> abc[i];
        sort(abc.begin(), abc.end());
        double a=abc[0], b=abc[1], c=abc[2];
        if (c<b+a) {
            ans1++;
            double tmp = a*a+b*b-c*c;
            if (tmp == 0) ans2++;
            else if (tmp > 0) ans3++;
            else if (tmp < 0) ans4++;
        }
        else {
            break;
        }
    }
    cout << ans1 << ' ' << ans2 << ' ' << ans3 << ' ' << ans4 << 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 == 1)
	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 <algorithm>
#include <iostream>
using namespace std;
int a[3], cnt, rt, at, ot, tmp;
int main() {
    while (cin >> a[0] >> a[1] >> a[2]) {
        sort(a, a + 3);
        if (a[0] + a[1] <= a[2]) {
            cout << cnt << " " << rt << " " << at << " " << ot << endl;
            return 0;
        }
        cnt++;
        tmp = a[0] * a[0] + a[1] * a[1] - a[2] * a[2];
        if (tmp == 0) rt++;
        if (tmp > 0) at++;
        if (tmp < 0) ot++;
    }
}

C++: #include <bits/stdc++.h>

using namespace std;

int v[3];

int main(){
	int a, b, c, d;
	
	a = b = c = d = 0;
	
	while(true){
		scanf("%d%d%d", &v[0], &v[1], &v[2]);
		
		sort(v, v + 3);
		
		if(v[2] < v[0] + v[1]){
			a++;
			
			if(v[2] * v[2] == v[0] * v[0] + v[1] * v[1])
			b++;
			else if(v[2] * v[2] > v[0] * v[0] + v[1] * v[1])
			d++;
			else
			c++;
		}
		else
		break;
	}
	
	printf("%d %d %d %d\n", a, b, c, d);
}

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

using namespace std;

int main(int argc, char const *argv[]) {
    int edge[3];
    int tri[3]={0};//0:right, 1:acute, 2:obtuse
    int total=0;

    while(1){
        for(int i=0;i<3;i++)
            cin >> edge[i];
        sort(edge,edge+3);
        if(edge[2] < edge[0] + edge[1]){
            total++;
            if(pow(edge[2],2) == pow(edge[0],2) + pow(edge[1],2)){
                tri[0]++;
            }else if(pow(edge[2],2) < pow(edge[0],2) + pow(edge[1],2)){
                tri[1]++;
            }else{
                tri[2]++;
            }
        }else{
            break;
        }
    }
    printf("%d %d %d %d\n",total,tri[0],tri[1],tri[2]);
    return 0;
}

C++: #include <stdio.h>
#include <algorithm>
#include <iostream>
#include <stack>
#include <vector>
#include <math.h>
#include <queue>

using namespace std;

int main(){

	int table[3],tyokkaku = 0,eikaku = 0,donkaku = 0;

	while(true){
		scanf("%d %d %d",&table[0],&table[1],&table[2]);

		for(int i = 1; i <=2; i++){
			for(int k =2; k >= i; k--){
				if(table[k] > table[k-1])swap(table[k],table[k-1]);
			}
		}

		if(table[0] + table[1] > table[2] && table[1]+table[2] > table[0] &&
				table[2] + table[0] > table[1]){
			if(table[0]*table[0] == table[1]*table[1]+table[2]*table[2])tyokkaku++;
			else if(table[0]*table[0] > table[1]*table[1]+table[2]*table[2]){
				donkaku++;
			}else{
				eikaku++;
			}
		}else{
			printf("%d %d %d %d\n",tyokkaku+eikaku+donkaku,tyokkaku,eikaku,donkaku);
			break;
		}
	}


    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,sum=0,ei=0,tyo=0,don=0;

  while(1){
    cin >> a >> b >> c;
    if(a > b){
      swap(a,b);
    }
    if(a > c){
      swap(a,c);
    }
    if(b > c){
      swap(b,c);
    }
    if( a+b <= c) break;
    sum++;
    if(c*c == a*a+b*b){
      tyo++;
    } else if(c*c > a*a+b*b){
      don++;
    } else if(c*c < a*a+b*b){
      ei++;
    }
  }
  cout << sum << " " << tyo << " " << ei << " " << don << endl;
  return 0;
}

C++: #include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int a[3], p, q, r;
int main() {
	while (true) {
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		if (a[0] + a[1] <= a[2]) { cout << p + q + r << ' ' << p << ' ' << q << ' ' << r << ' ' << endl; }
		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) { p++; }
		if (a[0] * a[0] + a[1] * a[1] > a[2] * a[2]) { q++; }
		if (a[0] * a[0] + a[1] * a[1] < a[2] * a[2]) { r++; }
	}
}

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

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

	return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	int a,b,c;
	int d[3];
	int A,B,C;
	A=B=C=0;
	while(cin>>a>>b>>c){
		d[0]=a;
		d[1]=b;
		d[2]=c;
		sort(d,d+3);
		if(d[0]+d[1]<=d[2]){
			cout <<A+B+C<<" "<<A<<" "<<B<<" "<<C<<endl;
			return 0;
		}
		int D =(d[0]*d[0]+d[1]*d[1]);
		int E =(d[2]*d[2]);
		if(D==E){
			A++;
		}else if(D >E){
			B++;
		}else if(D <E){
			C++;
		}
	}
	return 0;
}