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 <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    vector<int> ret(4, 0);

    for(;;){
        vector<int> a(3);
        for(int i=0; i<3; ++i)
            cin >> a[i];
        sort(a.begin(), a.end());

        if(a[0] + a[1] <= a[2])
            break;
        ++ ret[0];

        int b = a[0] * a[0] + a[1] * a[1];
        int c = a[2] * a[2];
        if(b < c)
            ++ ret[3];
        else if(b > c)
            ++ ret[2];
        else
            ++ ret[1];
    }

    for(int i=0; i<3; ++i)
        cout << ret[i] << ' ';
    cout << ret[3] << endl;

    return 0;
}

C++: #include<stdio.h>
 
int main(){
	int a[3], b, i, j, e = 0, f = 0, g = 0, h = 0;
	while(scanf("%d %d %d", &a[0], &a[1], &a[2]) != EOF){
		for(i = 0; i < 2; i++){
			for(j = i + 1; j < 3; j++){
				if(a[i] < a[j]){
					b = a[i];
					a[i] = a[j];
					a[j] = b;
				}
			}
		}
		if(a[0] >= a[1] + a[2]) continue;
		else e++;
		if(a[0] * a[0] > a[1] * a[1] + a[2] * a[2]) f++;
		else if(a[0] * a[0] == a[1] * a[1] + a[2] * a[2]) g++;
		else h++;
	}
	printf("%d %d %d %d\n", e, g, h, f);
	return 0;
}

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

using namespace std;

//define
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define dump(x)  cerr << #x << " = " << (x) << endl;

#define INF (INT_MAX/3)
#define PI (2*acos(0.0))
#define EPS (1e-8)

typedef long long ll;
typedef unsigned long long ull;

int main(){
  ios_base::sync_with_stdio(0);
  int a, b, c;
  int tr = 0, rtr = 0, actr = 0, obtr = 0;
  bool end = false;
  while(cin >> a >> b >> c){
    if(a + b <= c || b + c <= a || c + a <= b) break;
    tr++;
    int arr[3] = {a, b, c};
    sort(arr, arr + 3);
    if(arr[0] * arr[0] + arr[1] * arr[1] == arr[2] * arr[2]) rtr++;
    else if(arr[0] * arr[0] + arr[1] * arr[1] > arr[2] * arr[2]) actr++;
    else obtr++;
  }
  printf("%d %d %d %d\n", tr, rtr, actr, obtr);
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int t[3],x,y;
int a=0,b=0,c=0;
int main(){
  while(1){
    cin>>t[0]>>t[1]>>t[2];
    sort(t,t+3);
    x=t[0]*t[0]+t[1]*t[1];
    y=t[2]*t[2];
    if(t[0]+t[1]<=t[2]){
      break;
    }else if(x==y){
      a++;
    }else if(x>y){
      b++;
    }else if(x<y){
      c++;
    }
  }
  cout<<a+b+c<<' '<<a<<' '<<b<<' '<<c<<endl;
  return 0;
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;

signed main() {
	vector<int>v(3, 0);
	int sankaku(0), chokkaku(0), eikaku(0), donkaku(0);
	while (cin >> v[0] >> v[1] >> v[2]) {
		sort(all(v));
		if (v[0] + v[1] > v[2]) {
			sankaku++;
			if (v[0] * v[0] + v[1] * v[1] == v[2] * v[2])chokkaku++;
			else if (v[0] * v[0] + v[1] * v[1] < v[2] * v[2])donkaku++;
			else eikaku++;
		}
		else break;
		//cout << sankaku << " " << chokkaku << " " << eikaku << " " << donkaku << endl;

	}
	cout << sankaku << " " << chokkaku << " " << eikaku << " " << donkaku << endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int a[100], b[100], c[100],d,e,f,n;
	n = 0;
	d = 0;
	e = 0;
	f = 0;
	while (n <= 100)
	{
	A:
		cin >> a[n] >> b[n] >> c[n];
		if (a[n] + b[n] <= c[n] || a[n] + c[n] <= b[n] || b[n] + c[n] <= a[n])
		{
			break;
		}
		else
		{
			if (a[n] * a[n] + b[n] * b[n] == c[n] * c[n] || a[n] * a[n] + c[n] * c[n] == b[n] * b[n] || b[n] * b[n] + c[n] * c[n] == a[n] * a[n])
			{
				d++;
				n++;
				goto A;
			}
		    if (a[n] * a[n] + b[n] * b[n] > c[n] * c[n] || a[n] * a[n] + c[n] * c[n] > b[n] * b[n] || b[n] * b[n] + c[n] * c[n] > a[n] * a[n])
			{
				e++;
				n++;
				goto A;
			}
			if (a[n] * a[n] + b[n] * b[n] < c[n] * c[n] || a[n] * a[n] + c[n] * c[n] < b[n] * b[n] || b[n] * b[n] + c[n] * c[n] < a[n] * a[n]) 
			{
				f++;
				e = e - 1;
				n++;
				goto A;
			}
		}
	}
	cout << n<<" "<<d<<" "<<e<<" "<<f<<endl;
	return 0;
}

C++: #include<cstdio>
int main(void){
    
    int a=0,b=0,c=0;
    int change=0;
    int right=0,obtuse=0,acute=0;
    int value=0,check=0,count=0;
    int flag=true;
    while(flag){
        count++;
        scanf("%d%d%d",&a,&b,&c);
        if(c<a){
            change=a;
            a=c;
            c=change;
        }
        if(c<b){
            change=b;
            b=c;
            c=change;
        }
        check=a+b-c;
        value=a*a+b*b-c*c;
        if(check<=0){
            break;
        }
        
        if(value==0){
            right++;
        }
        else if(value<0){
            obtuse++;
        }
        else{
            acute++;
        }
    }
    printf("%d %d %d %d\n",count,right,acute,obtuse);
    return 0;
}

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

bool exist(int a,int b,int c){
    bool flag=false;
    if(a>0&&b>0&&c>0&&a+b>c&&a+c>b&&c+b>a)flag=true;
    return flag;
}
int type_check(int a,int b,int c){
    if(a*a==c*c+b*b)return 0;
    else if(a*a<b*b+c*c)return 1;
    else if(a*a>c*c+b*b)return 2;
    else return 3;
}

int main(){
    int c1=0,c2=0,c3=0,c4=0;
    int t_side[3];
    while(true){
        cin >> t_side[0]>>t_side[1]>>t_side[2];
        sort(t_side, t_side + 3, greater<int>());
        if(!exist(t_side[0],t_side[1],t_side[2]))break;
        switch(type_check(t_side[0],t_side[1],t_side[2])){
            case 0: c1++; break;
            case 1: c2++; break;
            case 2: c3++; break;
        }
        c4++;
    }
    cout <<c4<<" "<<c1<<" "<<c2<<" "<<c3<<endl;
    return 0;
}