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>
#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 <cstdio>
#include <algorithm>
using namespace std;

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

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

int main(){
    int a;
    int b;
    int c;
    int t=0;
    int e=0;
    int d=0;
    int all=0;
    while(1){
        cin>>a>>b>>c;
        if(a+b<c||a+c<b||b+c<a){
            cout<<all<<" "<<t<<" "<<e<<" "<<d<<endl;
            break;
        }
        all = all+1;
        if((a*a)+(b*b)==(c*c)||(b*b)+(c*c)==(a*a)||(a*a)+(c*c)==(b*b)){
            t=t+1;
            
        }else if((a*a)+(b*b)<c*c||(b*b)+(c*c)<a*a||(a*a)+(c*c)<b*b){
            d=d+1;
            
        }else if((a*a)+(b*b)>c*c||(b*b)+(c*c)>a*a||(a*a)+(c*c)>b*b){
            e=e+1;
            
        }
    }
//    cout<<all<<" "<<t<<" "<<e<<" "<<d<<endl;
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#include <ostream>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

std::ostream& operator << (std::ostream& os, const std::vector<int>& v) {
  for (int i = 0; i < v.size(); ++i) {
    os << v[i] << " \n"[i == v.size() - 1];
  }
  return os;
}

int main() {
  std::vector<int> tri(4, 0), edge(3);

  while (cin >> edge[0] >> edge[1] >> edge[2]) {
    std::sort(edge.begin(), edge.end(), std::greater<int>());

    int largest = edge[0] * edge[0], others = edge[1] * edge[1] + edge[2] * edge[2];

    if (edge[0] >= edge[1] + edge[2]) {
      break;
    }
    else if (largest == others) {
      tri[1]++;
    }
    else if (largest < others) {
      tri[2]++;
    }
    else if (largest > others) {
      tri[3]++;
    }

    tri[0]++;
  }

  cout << tri << endl;

  return 0;
}

C++: #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;a++) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	vector <int>a(3);
	int choku = 0, ei = 0, don = 0;
	while (cin >> a[0] >> a[1] >> a[2]) {
		Sort(a);
		if (a[0] + a[1] <= a[2])
		{
		break;
		}
		int a2[3];
		rep(i, 3) {
			a2[i] = a[i] * a[i];
		}
		if (a2[0] + a2[1] == a2[2]) 
		{ 
			choku++;
		}
		else if (a2[0] + a2[1] > a2[2]) 
		{ 
			ei++;
	//cout << "shine" << endl;
		}
		else 
		{
			don++;
		}
	}
	cout << choku + ei + don << " " << choku << " " << ei << " " << don << endl;
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n;
	int a,b,c;
	int d,e,f;
	int s;
	int i;
	int cnt,cnt1,cnt2,cnt3;
	cnt=cnt1=cnt2=cnt3=0;
	
	while(scanf("%d %d %d",&a,&b,&c)!=EOF){
		//for(i=0;i<5;i++){
			d=a*a;
			e=b*b;
			f=c*c;
			if(c>=a && c>=b && c<a+b || b>=a && b>=c && b<c+a || a>=c && a>=b && a<b+c){
				cnt++;
				if(c>=a && c>=b){
					s=f-d-e;
					if(s==0){
						cnt1++;
					}
					else if(s<0){
						cnt2++;
					}
					else if(s>0){
						cnt3++;
					}
				}
				else if(b>=a && b>=c){
					s=e-d-f;
					if(s==0){
						cnt1++;
					}
					else if(s<0){
						cnt2++;
					}
					else if(s>0){
						cnt3++;
					}
				}
				else if(a>=c && a>=b){
					s=d-f-e;
					if(s==0){
						cnt1++;
					}
					else if(s<0){
						cnt2++;
					}
					else if(s>0){
						cnt3++;
					}
				}
			}
			else if(c>=a && c>=b && c>=a+b || b>=a && b>=c && b>=c+a || a>=c && a>=b && a>=b+c){
				break;
			}
		//}
	}
	printf("%d %d %d %d\n",cnt,cnt1,cnt2,cnt3);
	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++;
				f = f - 1;
				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++;
				n++;
				goto A;
			}
		}
	}
	cout << n<<" "<<d<<" "<<e<<" "<<f<<endl;
	return 0;
}

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

int a, b, c, s, x, y;
int d = 0, e = 0, t = 0;

int main() {

	while (1) {
		cin >> a >> b >> c; //各辺の入力

		if (a + b <= c)		//aとbを固定して三角形の条件式
			break;

		x = a ^ 2 + b ^ 2;	//aとbを固定して計算
		y = c ^ 2;			//cを固定して計算

		if (x < y)
			e++;
		if (x == y)
			t++;
		if (x > y)
			d++;
	}

	s = d + e + t;
	cout << s << " " << t << " " << e << " " << d << endl;

	return 0;

}