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 <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <cstring>
 
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define MP make_pair
#define X first
#define Y second
#define all(v) v.begin(), v.end()
#define rev(v) v.rbegin(), v.rend()

using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> P;

const int INF = 1<<29;

int check(int a[3]){
	if(a[2] >= a[1]+a[0]) return -1;
	int x = a[2]*a[2]-a[1]*a[1]-a[0]*a[0];
	if(x > 0) return 2;
	if(x < 0) return 1;
	return 0;
}

int main(){
	int a[3];
	int cnt[3] = {};
	while(1){
		rep(i, 3) cin >> a[i];
		sort(a, a+3);
		if(check(a) == -1) break;
		cnt[check(a)]++;
	}
	cout << cnt[0]+cnt[1]+cnt[2];
	rep(i, 3){
		cout << ' ' << cnt[i];
	}
	cout << endl;

    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
 
using namespace std;
 
#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
 
template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }
 
typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
 
int main(){
  int a, b, c;
  int ans[4] = {};
  while(cin>>a>>b>>c){
    if(!(c > b - a)) break;
    if(!(c > a - b)) break;
    if(!(c < a + b)) break;
    if(a > b) swap(a, b);
    if(b > c) swap(b, c);
    int D = a * a + b * b  - c * c;
    ans[0]++;
    if(D > 0) ans[1]++;
    if(D == 0) ans[2]++;
    if(D < 0) ans[3]++;
  }
  printf("%d %d %d %d\n", ans[0], ans[2], ans[1], ans[3]);
  return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int a,b,c,s=0,s1=0,s2=0,s3=0,q;
	while(cin>>a>>b>>c)
	{
		if(a<b)
		{
			q=a;a=b;b=q;
		}
		if(a<c)
		{
			q=a;a=c;c=q;
		}
		if(a>=b+c)break;
		else
		{
			s++;
			if((a*a)==(b*b)+(c*c))s1++;
			else if((a*a)<(b*b)+(c*c))s2++;
			else if((a*a)>(b*b)+(c*c))s3++;
		}
	}
	cout<<s<<" "<<s1<<" "<<s2<<" "<<s3<<" ";
}

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

using namespace std;

int main()
{
    int acute = 0;
    int obtuse = 0;
    int right = 0;

    while (true) {
        int a, b, c;
        cin >> a >> b >> c;

        auto checkTriangle = [](int a, int b, int c) { return a < (b + c); };
        auto radToDegree = [](double rad) { return rad * 180 / M_PI; };
        auto angle = [radToDegree](int a, int b, int c) {
            auto x = static_cast<double>(b * b + c * c - a * a) / (2 * b * c);
            return radToDegree(acos(x));
        };
        auto isObtuse = [](double theta) {
            return 90.0 < theta && theta < 180.0;
        };

        if (checkTriangle(a, b, c) && checkTriangle(b, a, b) &&
            checkTriangle(c, a, b)) {
            auto theta1 = angle(a, b, c);
            auto theta2 = angle(b, a, c);
            auto theta3 = angle(c, a, b);
            if (theta1 == 90.0 || theta2 == 90.0 || theta3 == 90.0) {
                right += 1;
            }
            else if (isObtuse(theta1) || isObtuse(theta2) || isObtuse(theta3)) {
                obtuse += 1;
            }
            else {
                acute += 1;
            }
        }
        else {
            cout << (acute + obtuse + right) << " " << right << " " << acute
                 << " " << obtuse << endl;
            break;
        }
    }
}

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

using namespace std;

int sankaku,eikaku,tyokkaku,donkaku;
int hen[3];

int main(void){

  sankaku = eikaku = tyokkaku = donkaku = 0;

  while( cin >> hen[0] >> hen[1] >> hen[2] ){

    sort( hen , hen + 3 );
    
    if( hen[2] >= hen[0] +  hen[1] ) continue;
    sankaku++;
    
    for( int i = 0 ; i < 3 ; i++ )
      hen[i] = pow( (double)hen[i] , 2 );
    
    if( hen[2] == hen[0] + hen[1] ) tyokkaku++;
    if( hen[2] < hen[0] + hen[1] ) eikaku++;
    if( hen[2] > hen[0] + hen[1] ) donkaku++;
    
  }
  cout << sankaku << " " << tyokkaku << " " << eikaku << " " << donkaku << endl;
  return 0;
}

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

using namespace std;

int main(){
  int all=0, a=0, b=0, c=0;
  vector<int> data(3);
  bool end = false;

  while(cin >> data[0] >> data[1] >> data[2]){
    if(end) continue;
    sort(data.begin(), data.end());

    if(data[0]+data[1] <= data[2]){
      cout << all << " " << a << " " << b << " " << c << endl;
      end = true;
      continue;
    }

    if(data[0]*data[0] + data[1]*data[1] == data[2]*data[2]) ++a;
    else if(data[0]*data[0] + data[1]*data[1] > data[2]*data[2]) ++b;
    else ++c;

    ++all;
  }
  return 0;
}

C++: #include<cstdio>

int main(void){
    
    int a=0,b=0,c=0;
    int change=0,judge=0,exi=0;
    int right=0,acute=0,obtuse=0,count=0;
    while(true){
        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;
        }
        judge=a*a+b*b-c*c;
        exi=a+b-c;
        if(exi<0){
            break;
        }
        if(judge>0){
            acute++;
        }
        else if(judge==0){
            right++;
        }
        else{
            obtuse++;
        }
        count++;
    }
    
    printf("%d %d %d %d\n",count,right,acute,obtuse);
    return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int ans[4]={0,0,0,0};
	int d[3];
	while(1){
		for(int i=0;i<3;i++)cin>>d[i];
		sort(d,d+3);
		if(d[0]+d[1]<=d[2])break;
		else if(d[0]*d[0]+d[1]*d[1]==d[2]*d[2])ans[1]++;
		else if(d[0]*d[0]+d[1]*d[1]>d[2]*d[2])ans[2]++;
		else ans[3]++;
		ans[0]++;
	}
	
	cout<<ans[0]<<" "<<ans[1]<<" "<<ans[2]<<" "<<ans[3]<<endl;
	return 0;
}