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, b, c;
    int tri=0, sharp=0, obtuse=0, right=0;
    while(cin>>a>>b>>c) {
        int temp = max({a, b, c});
        if(temp==b) {
            swap(a, b);
        } else if(temp==c) {
            swap(a, c);
        }
        if(a>=b+c) break;
        tri++;
        int d = b*b+c*c-a*a;
        if(d==0) right++;
        else if(d>0) sharp++;
        else obtuse++;
    }
    cout << tri << ' ' << right << ' ' << sharp << ' ' << obtuse << '\n';

    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n;
	int a[100],b[100],c[100];
	int d,e,f;
	int s;
	int i;
	int flg[100];
	int cnt,cnt1,cnt2,cnt3;
	int max;
	cnt=cnt1=cnt2=cnt3=0;
	
	for(i=0;i<5;i++){
		scanf("%d %d %d",&a[i],&b[i],&c[i]);
	}
	for(i=0;i<5;i++){
		d=a[i]*a[i];
		e=b[i]*b[i];
		f=c[i]*c[i];
		if(c[i]>=a[i] && c[i]>=b[i] && c[i]<a[i]+b[i] || b[i]>=a[i] && b[i]>=c[i] && b[i]<c[i]+a[i] || a[i]>=c[i] && a[i]>=b[i] && a[i]<b[i]+c[i]){
			cnt++;
			if(c[i]>=a[i] && c[i]>=b[i]){
				s=f-d-e;
				if(s==0){
					cnt1++;
				}
				else if(s<0){
					cnt2++;
				}
				else if(s>0){
					cnt3++;
				}
			}
			else if(b[i]>=a[i] && b[i]>=c[i]){
				s=e-d-f;
				if(s==0){
					cnt1++;
				}
				else if(s<0){
					cnt2++;
				}
				else if(s>0){
					cnt3++;
				}
			}
			else if(a[i]>=c[i] && a[i]>=b[i]){
				s=d-f-e;
				if(s==0){
					cnt1++;
				}
				else if(s<0){
					cnt2++;
				}
				else if(s>0){
					cnt3++;
				}
			}
		}
		else if(c[i]>=a[i] && c[i]>=b[i] && c[i]>=a[i]+b[i] || b[i]>=a[i] && b[i]>=c[i] && b[i]>=c[i]+a[i] || a[i]>=c[i] && a[i]>=b[i] && a[i]>=b[i]+c[i]){
			break;
		}
	}
	printf("%d %d %d %d\n",cnt,cnt1,cnt2,cnt3);
	return 0;
}

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

using namespace std;

int data[3];
int ans[4];

int main(){

  
  while(cin >> data[0] >> data[1] >> data[2]){
    sort(data,data+3);
    if(data[0] + data[1] <= data[2]) break;
    ans[0]++;

    int tmp = data[0]*data[0]+data[1]*data[1];

    if(tmp > data[2]*data[2]) ans[1]++;
    if(tmp == data[2]*data[2]) ans[2]++;
    if(tmp < data[2]*data[2]) ans[3]++;
  }

  cout << ans[0] << " " << ans[2] << " " << ans[1] << " " << ans[3] << endl;
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a, b, c;
  int p = 0, q = 0, r = 0, s = 0;
  while(scanf("%d %d %d\n", &a, &b, &c)){
    int maxx = a;
    if(maxx < b) maxx = b;
    if(maxx < c) maxx = c;
    if( 2 * maxx < a + b + c ) {
      p++;
      if(2 * pow(maxx, 2) == a*a + b*b + c*c) q++;
      else if(2 * pow(maxx,2) < a*a + b*b + c*c) r++;
      else s++;
    }
  }
  printf("%d %d %d %d\n", p, q, r ,s);

  return 0;
}

C++: #include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int cnt;
	int a,b,c;
	a = b = c = cnt = 0;
	while(true){
		int A[5];
		for(int i = 0; i < 3; i++){
			int tmp;
			scanf("%d",&tmp);
			A[i] = tmp;
		}
		sort(A,A+3);
		if(A[2] >= A[1] + A[0])break;
		cnt++;
		if(A[0]*A[0] + A[1]*A[1] == A[2]*A[2])a++;
		else if(A[0]*A[0] + A[1]*A[1] > A[2]*A[2])b++;
		else if(A[0]*A[0] + A[1]*A[1] < A[2]*A[2])c++;
	}
	printf("%d %d %d %d\n",cnt,a,b,c);
	return 0;
}

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

enum{TRIANGLE, RIGHT, ACUTE, OBTUSE, N};

int main()
{
    vector<int> count(N, 0);
    vector<int> edge(3);
    while(cin>>edge[0]>>edge[1]>>edge[2]) {
        sort(edge.begin(), edge.end(), greater<int>());

        if(edge[0] < edge[1] + edge[2]) {
            count[TRIANGLE]++;
        } else {
            cout<<count[TRIANGLE];
            for(int i=1; i<N; i++) cout<<" "<<count[i];
            cout<<endl;
            break;
        }

        int d = edge[0]*edge[0] - edge[1]*edge[1] - edge[2]*edge[2];
        if(d == 0) {
            count[RIGHT]++;
        } else if(d < 0) {
            count[ACUTE]++;
        } else if(d > 0) {
            count[OBTUSE]++;
        }
    }
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

void sort(int *a, int *b, int *c){
  int tmp;
  if(*a == max(*a, max(*b, *c))){
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }else if(*b == max(*b, *c)){
    tmp = *a, *a = *b, *b = tmp;
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }else{
    tmp = *a, *a = *c, *c = tmp;
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }
}

int judge(int a, int b, int c){ // 1:直角三角形 2:鋭角三角形 3:鈍角三角形
  if(SQ(a) == SQ(b) + SQ(c)) return 1;
  if(SQ(a) < SQ(b) + SQ(c)) return 2;
  if(SQ(a) > SQ(b) + SQ(c)) return 3;
  return 0;
}

int main(){
  int A, B, C;
  ll res[4];
  memset(res, 0, sizeof(res));
  while(cin >> A >> B >> C){
    sort(&A, &B, &C);
    if(A >= B + C) break;
    res[0]++;
    res[judge(A, B, C)]++;
  }

  cout << res[0] << " " << res[1] << " " << res[2] << " " << res[3] << endl;
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
main(){
  int tri[3];
  int s = 0, e = 0, t = 0, d = 0;
  while (cin>>tri[0]>>tri[1]>>tri[2]){
    sort(tri,tri+3);
    if (tri[2]>=tri[0]+tri[1]) break;
    s++;
    if (tri[2]*tri[2]==tri[0]*tri[0]+tri[1]*tri[1]) t++;
    if (tri[2]*tri[2]>tri[0]*tri[0]+tri[1]*tri[1]) d++;
    if (tri[2]*tri[2]<tri[0]*tri[0]+tri[1]*tri[1]) e++;
  } 
  cout <<s<<" "<<t<<" "<<e<<" "<<d<< endl;
  return 0;
}