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"
#define rep(i,a,n) for(int i = a;i < n;i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

int main(){
    int a[3],cnt[4] = {0};
    
    while(cin >> a[0]){
        cin >> a[1] >> a[2];
        
        sort(a,a+3);
        
        if(a[0] + a[1] > a[2])
            if(a[1] + a[2] > a[0])
                if(a[0] + a[2] > a[1])cnt[0]++;
                else break;
            else break;
        else break;
        
        if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]) cnt[1]++;
        else if(a[0]*a[0]+a[1]*a[1] < a[2]*a[2])cnt[3]++;
        else if(a[0]*a[0]+a[1]*a[1] > a[2]*a[2])cnt[2]++;
        
    }
    
    cout << cnt[0] << " " << cnt[1] << " " << cnt[2] << " " << cnt[3] << endl;
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#define SQ(x) ((x)*(x))
using namespace std;
int main(void){
  int a[3],b[4]={},c=0;
  while(cin>>a[0]>>a[1]>>a[2]){
    if(!c){
      sort(&a[0],&a[3]);
      if(!(a[0]+a[1]>a[2])){c=1;continue;}
      ++b[0];
      if(SQ(a[0])+SQ(a[1])>SQ(a[2])) ++b[2];
      else if(SQ(a[0])+SQ(a[1])==SQ(a[2])) ++b[1];
      else ++b[3];
    }
  }
  cout<<b[0]<<" "<<b[1]<<" "<<b[2]<<" "<<b[3]<<endl;
  return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

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

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

#define EPS 1e-8

int main(){
    int a,b,c,d;
    int x,y,z;
    while(cin>>x>>y>>z){
        vi in;
        in.pb(x);
        in.pb(y);
        in.pb(z);
        sort(all(in));
        
        if(in[0]+in[1]<=in[2]){
            cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
            while(cin>>x>>y>>z);
            break;
        }
        else a++;
        
        double l,m,n;
        l = acos( (-1*in[0]*in[0] + in[1]*in[1] + in[2]*in[2])/(2.0*in[1]*in[2]) );
        m = acos( (-1*in[1]*in[1] + in[2]*in[2] + in[0]*in[0])/(2.0*in[2]*in[0]) );
        n = acos( (-1*in[2]*in[2] + in[0]*in[0] + in[1]*in[1])/(2.0*in[0]*in[1]) );
        
        l=l*180/3.141592;
        m=m*180/3.141592;
        n=n*180/3.141592;

        
        if( (l-90)*(l-90)<EPS || (m-90)*(m-90)<EPS || (n-90)*(n-90)<EPS ){
            b++;
        }
        else if( l>90-EPS || m>90-EPS || n>90-EPS ){
            d++;
        }
        else c++;
    }
}

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

using namespace std;

int main(void)
{
	int a, b, c;
	int t1, t2, t3, t4;
	
	t1 = t2 = t3 = t4 = 0;
	
	while (scanf("%d %d %d", &a, &b, &c) != EOF){
		if (a < b){
            swap(a, b);
        }
        if (a < c){
            swap(a, c);
        }
        if (b < c){
            swap(b, c);
        }
		
		if (a >= b + c){
            break;
        }
		if (a * a == b * b + c * c){
			t1++;
			t2++;
		}
		else if (a * a < b * b + c * c){
            t1++;
			t3++;
		}
		else {
			t1++;
			t4++;
		}
	}
	
	printf("%d %d %d %d\n", t1, t2, t3, t4);
	
	return (0);
}

C++: #include<stdio.h>
#include<string.h>

int max(int a, int b, int c) {
	if (a >= b && a >= c)return a;
	else if (b > a&&b >= c)return b;
	else return c;
}

int mid(int a, int b, int c) {
	if (a >= b && a >= c) {
		if (b >= c)return b;
		else return c;
	}
	else if (b > a&&b >= c) {
		if (a >= c)return a;
		else return c;
	}
	else {
		if (a >= b)return a;
		else return b;
	}
}

int min(int a, int b, int c) {
	if (a <= b && a <= c)return a;
	else if (b < a&&b <= c)return b;
	else return c;
}


int main() {
	int a, b, c;
	int max1, mid1, min1;
	int out[4] = { 0,0,0,0 };
	while (1) {
		scanf("%d %d %d", &a, &b, &c);
		max1 = max(a, b, c);
		mid1 = mid(a, b, c);
		min1 = min(a, b, c);
		if (max1 >= mid1 + min1) {
			break;
		}
		out[0] += 1;
		if (max1*max1 == mid1 * mid1 + min1 * min1) {
			out[1] += 1;
		}
		else if (max1*max1 < mid1*mid1 + min1 * min1) {
			out[2] += 1;
		}
		else out[3] += 1;
	}
	printf("%d %d %d %d\n", out[0], out[1], out[2], out[3]);

	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=a;
        }
        if(c<b){
            change=b;
            a=b;
            b=a;
        }
        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",count,right,obtuse,acute);
    return 0;
}