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++: // 2014/06/26 Tazoe

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	int cnt0 = 0;
	int cnt1 = 0;
	int cnt2 = 0;
	int cnt3 = 0;

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

		if(a<b){
			swap(a, b);
		}
		if(a<c){
			swap(a, c);
		}

		if(a>=b+c){
			cout << cnt0 << ' ' << cnt1 << ' ' << cnt2 << ' ' << cnt3 << endl;
			break;
		}

		cnt0++;

		if(a*a==b*b+c*c){
			cnt1++;
		}
		else if(a*a<b*b+c*c){
			cnt2++;
		}
		else{
			cnt3++;
		}
	}

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
	int a[3],b,c,d,e;
	b=c=d=e=0;
	while(scanf("%d %d %d",&a[0],&a[1],&a[2])!=EOF){
		sort(a,a+3);
		if(a[0]+a[1]<=a[2]){
				cout << b << " " << c << " " << d << " " << e << endl;
				return 0;
		}
		b++;
		if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])	c++;
		if(a[0]*a[0]+a[1]*a[1]>a[2]*a[2])	d++;
		if(a[0]*a[0]+a[1]*a[1]<a[2]*a[2])	e++;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;

bool istriangle(int a, int b, int c){
    int cnt=0;

    if(a<b+c)cnt+=1;
    if(b<a+c)cnt+=1;
    if(c<a+b)cnt+=1;

    if(cnt==3)return true;
    else return false;
}

int whichtriangle(int a, int b, int c){
    int longest, sub1, sub2;
    if(a>b){
        longest=a;
        sub1=b;
    }
    else {
        longest=b;
        sub1=a;
    }
    if(c>longest){
        sub2=longest;
        longest=c;
    }
    else {
        sub2=c;
    }

    if(longest*longest==sub1*sub1+sub2*sub2)return 1;
    else if(longest*longest>sub1*sub1+sub2*sub2)return 3;
    else return 2;

}

int main(){

    int a, b, c;
    int t=0;
    int types[4]={0, 0, 0, 0};

    while (1){
        cin >> a >> b >> c;
        if(istriangle(a, b, c) == 0)break;

        types[whichtriangle(a, b, c)]+=1;
        t+=1;

    }

    cout << t;
    for(int i=1;i<4;i++){
        cout << " " << types[i];
    }

    cout << endl;

}

C++: #include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;

int main(){
  double a,b,c;
  int cnt[4];
  fill(cnt,cnt+4,0);
  while(cin >> a >> b >> c){
    double array[3];
    int sum = a + b + c;
    int Max = max(a,max(b,c));
    int remain = sum - Max;

    if(Max >= remain){
      continue;
    }

    array[0] = a;
    array[1] = b;
    array[2] = c;
    sort(array,array+3);

    double Max_angle = 0;
    do{
      double tmp = (array[0]*array[0]+array[2]*array[2]-array[1]*array[1])/
	(2*array[0]*array[2]);

      Max_angle = max(Max_angle,acos(tmp));
    }while(next_permutation(array,array+3));

    cnt[0]++;

    if(Max_angle > M_PI / 2.0) cnt[3]++;
    else if(Max_angle < M_PI / 2.0) cnt[2]++;
    else cnt[1]++;

  }
  for(int i=0; i<4; i++){
    if(i == 0) cout << cnt[i];
    else cout << " " << cnt[i];
  }
  cout << endl;
  
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int ans[4] = {0};
int a, b, c;
vector<int> v;

int main() {
  while(1) {
    cin >> a >> b >> c;
    v.push_back(a);
    v.push_back(b);
    v.push_back(c);
    sort(v.begin(), v.end());
    if(v[0] + v[1] <= v[2]) break;
    ++ans[0];
    a = v[0] * v[0] + v[1] * v[1];
    b = v[2] * v[2];
    if(a == b)
      ++ans[1];
    else if(a > b)
      ++ans[2];
    else
      ++ans[3];
    v.erase(v.begin(), v.end());
  }
  cout << ans[0] << " " << ans[1] << " " << ans[2] << " "
       << ans[3] << 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);
	a[0] = a[1] = a[2] = 0;
	int choku = 0, ei = 0, don = 0;
	while (cin >> a[0] >> a[1] >> a[2]) {
		Sort(a);
		if (a[0] + a[1] <= a[2])
		{
			continue;
		}
		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++;
		}
		else 
		{
			don++;
		}
	}
	cout << choku + ei + don << " " << choku << " " << ei << " " << don << endl;
	return 0;
}

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

int main()
{
  double a, b, c;
  int chokaku = 0, eikaku = 0, donkaku = 0;
  
  while(1){
    scanf("%lf %lf %lf", &a, &b, &c);
    if ( a + b > c && a + c > b && b + c > a ) {
      if ( a*a + b*b == c*c || a*a + c*c == b*b || b*b + c*c == a*a) {
	chokaku++;
      } else if ( asin(a/b) < M_PI / 2. && asin(a/c) < M_PI / 2. && asin(b/c) < M_PI / 2) {
	eikaku++;
      } else {
	donkaku++;
      }
    } else {
      break;
    }
  }
  
  printf("%d %d %d %d\n", eikaku+donkaku+chokaku, chokaku, donkaku, eikaku);
  
  return (0);
}

C++: #include<iostream>
using namespace std;
int main(){
    int a,b,c,l=0,m=0,n=0,o=0;
    while(1){
         cin>>a>>b>>c;
         if(a+b>c&&b+c>a&&a+c>b){
           l+=1;
           if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a){
             m+=1;
           }
           int j=0;
           if(j<a){
           j+=a;
           }
           if(j<b){
           j+=b;
           }
           if(j<c){
           j+=c;
           }
           if(j==a){
             if(a*a<b*b+c*c){
               n+=1;
             }
             if(a*a>b*b+c*c){
               o+=1;
             }
           }
           else if(j==b){
             if(b*b<a*a+c*c){
               n+=1;
             }
             if(b*b>a*a+c*c){
               o+=1;
             }
           }
           else {
                  if(c*c<b*b+a*a){
                    n+=1;
                  }
                  if(c*c>b*b+a*a){
                    o+=1;
                  }
           }
         }
         else{break;}
     }
     cout<<l<<" "<<m<<" "<<n<<" "<<o<<endl;
     return 0;
}