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>
#include <algorithm>
using namespace std;
int main(){
	int a[3],w=0,x=0,y=0,z=0;
	while(cin>>a[0]>>a[1]>>a[2]){
		sort(a,a+3);
        if(a[0]+a[1]<=a[2])break;
		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++;
		w++;
	}
	cout<<w<<" "<<x<<" "<<y<<" "<<z<<endl;
    return 0;
    }

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

int main() {
    int x,y,z;
    int san,don,cho,ei;
    for(int i=0;;i++){
        cin >> x >> y >> z;
        int a = max(max(x,y),z),b,c;
        if(a == x) b=y,c=z;
        else if(a == y) b=z,c=x;
        else if(a == z) b=x,c=y;

        if(a >= b+c){ cout << san << ' ' << cho << ' ' << ei << ' ' << don << endl;
                    return 0;}

        else if(a*a > b*b + c*c){
            san++;
            don++;
        }
        else if(a*a == b*b + c*c){
            san++;
            cho++;
        }
        else if(a*a < b*b + c*c){
            san++;
            ei++;
        }
    }
}

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

int main(){
    
    int a,b,c;
    int s,ch,e,d;
    s = ch = e = d = 0;
    
    while(1){
        cin >> a >> b >> c;
        if(a==0) break;
        s++;
        a=a*a;
        b=b*b;
        c=c*c;
        int hantei;
        if(a>b){
            if(a>c){
                hantei=a-b-c;
            }else{
                hantei=c-a-b;
            }
        }else{
            if(b>c){
                hantei=b-a-c;
            }else{
                hantei=c-a-b;
            }
        }
        if(hantei>0){
            d++;
        }else if(hantei<0){
            e++;
        }else{
            ch++;
        }
    }
    
    cout << s << " " << ch << " " << e << " " << d << endl;
    
    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])
				y++;
			else z++;
		}
	}
	cout << x + y + z << ' ' << x << ' ' << y << ' ' << z << endl;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>
using namespace std;
int a, b, c;
int cnt_a, cnt_b, cnt_c;
bool flag = true;
int main() {
	int i = 0;
	while (cin >> a >> b >> c, flag) {
		int maxV, minV, cen;
		maxV = max(a, max(b, c));
		minV = min(a, min(b, c));
		cen = a + b + c - minV - maxV;
		
		if (a + b > c&&a + c > b&&b + c > a) {
			if (minV*minV + cen * cen - maxV * maxV == 0) {
				cnt_b++; i++;
				continue;
			}
			 else if (minV*minV + cen * cen - maxV * maxV > 0) {
				cnt_a++; i++;
				continue;
			}
			
			else if (minV*minV + cen * cen - maxV * maxV < 0) {
				cnt_c++; i++;
				continue;
			}
		}else {
			flag = false;
		}
		if (!flag) break;
	}
	cout << i << " " << cnt_b << " " << cnt_a << " " << cnt_c << endl;
	return 0;
}

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

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

using namespace std;

int main()
{
	int a, b, c;
	int na, nb, nc, nd;
	
	na = nb = nc = nd = 0;
	while (1){
		scanf("%d %d %d", &a, &b, &c);
		if (a < b) swap(a, b); if (a < c) swap(a, c);
		if (a >= b + c) break;
		
		na++;
		if (b * b + c * c == a * a) nc++;
		else if (b * b + c * c < a * a) nd++;
		else nb++;
	}
	printf("%d %d %d %d\n", na, nc, nb, nd);
	
	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[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])
				y++;
			else z++;
		}
	}
	cout << w << ' ' << x << ' ' << y << ' ' << z << endl;
}

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

C++: #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
//#define int long long
using namespace std;

int a[3];
int eikaku, tyokkaku, donkaku;

signed main()
{
	while (true) {
		rep(i,3) cin >> a[i];
		sort(a, a + 3);

		if (a[2] >= a[0] + a[1]) {
			cout << eikaku + tyokkaku + donkaku << " " << tyokkaku << " " << eikaku << " " << donkaku << endl;
			break;
		}

		if (a[0]*a[0] + a[1]*a[1] - a[2]*a[2] == 0) {
			tyokkaku++;
		} else if (a[0]*a[0] + a[1]*a[1] - a[2]*a[2] < 0) {
			donkaku++;
		} else {
			eikaku++;
		}
	}
}