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>

using namespace std;

int main() {
  int count_total = 0; // 合計
  int count_1 = 0; // 直角三角形
  int count_2 = 0; // 鋭角
  int count_3 = 0; // 鈍角
  while(true) {
    int long_side = 0;
    int short_side1 = 0;
    int short_side2 = 0;
    int a, b, c = 0;
    cin >> a >> b >> c;
    if (!(abs(b-c) < a && a < b + c)) {
      //cout << "-----" << endl;
      cout << count_total << " " << count_1 << " " << count_2 << " " << count_3 << endl;
      return 0;
    }
    count_total++;
    int max_side = a;
    if (b > a && b > c) {
      // bが一番長い
      long_side = b;
      short_side1 = a;
      short_side2 = c;
    } else if (c > a && c > b) {
      // cが一番長い
      long_side = c;
      short_side1 = a;
      short_side2 = b;
    } else {
      // aが一番長い
      long_side = a;
      short_side1 = b;
      short_side2 = c;
    }
    int d1 = long_side * long_side;
    int d2 = short_side1 * short_side1 + short_side2 * short_side2;
    // 鈍角
    if (d1 > d2) {
      count_3++;
    } else if (d1 == d2) {
      // 直角
      count_1++;
    } else {
      // 鋭角
      count_2++;
    }
  }

}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <cassert>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define chmax(a,b) (a<(b)?(a=b,1):0)
#define chmin(a,b) (a>(b)?(a=b,1):0)
#define valid(y,x,h,w) (0<=y&&y<h&&0<=x&&x<w)
const int INF = 1<<29;
const double EPS = 1e-8;
const double PI = acos(-1);
typedef pair<int,int> pii;
typedef long long ll;

typedef complex<double> P;
P pIN() { double x,y; cin >> x >> y; return P(x,y); }
namespace std {
  bool operator < (const P& a, const P& b) {
    // if (abs(a-b)<EPS) return 0;
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}
double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}
struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
  L() { resize(2); }
};
ostream &operator<<(ostream &os, const L &a) {
  os << a[0] << " -> " << a[1];
  return os;
}
typedef vector<P> G;

bool isTriangle(const G &t) {
  if (t.size() != 3) return 0;
  if (abs(cross(t[1]-t[0], t[2]-t[0])) < EPS) return 0; // line or dot
  return 1;
}
int typeByLength(const G &t) {
  double a = norm(t[0]-t[1]);
  double b = norm(t[1]-t[2]);
  double c = norm(t[2]-t[0]);
  if (abs(a-b) < EPS && abs(b-c) < EPS) return 0; // Equilateral
  if (abs(a-b) < EPS || abs(b-c) < EPS || abs(c-a) < EPS) return 1; // Isosceles
  return 2;                     // Scalene
}
int typeByAngle(const G &t) {
  REP(i,3) {
    double tmp = dot(t[(i+1)%3]-t[i], t[(i+2)%3]-t[i]);
    if (abs(tmp) < EPS) return i+1; // Right
    if (tmp < 0) return -i-1;        // Oblique
  }
  return 0;                     // Acute
}
bool isTriangle(double a, double b, double c) {
  return abs(a-b)+EPS < c && c < a+b-EPS;
}
G triangleFromLength(double a, double b, double c) {
  G t(3);
  t[0] = P(0,0);
  t[1] = P(a,0);
  double x = (a*a+b*b-c*c)/(2*a);
  t[2] = P(x,sqrt(b*b-x*x));
  return t;
}
int main() {
  int a,b,c;
  int A=0,B=0,C=0,D=0;
  while(cin >> a >> b >> c) {
    if (!isTriangle(a,b,c)) break;
    G t = triangleFromLength(a,b,c);
    A++;
    int type = typeByAngle(t);
    if (type == 0) C++;
    else if (type > 0) B++;
    else D++;
  }
  printf("%d %d %d %d\n",A,B,C,D);
}

C++: #include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());


int main(){
	int x,y,z;
	int a,b,c;
	int ans1=0,ans2=0,ans3=0;
	while(cin>>x>>y>>z){
		a=max(max(x,y),z);
		b=min(min(x,y),z);
		c=x+y+z-a-b;
		// cout<<a<<" "<<b<<" "<<c<<endl;
		if(a>=b+c){
			cout<<ans1+ans2+ans3<<" "<<ans1<<" "<<ans2<<" "<<ans3<<endl;
			return 0;
		}
		else{
			if(a*a==b*b+c*c){
				ans1++;
			}
			else if(a*a<b*b+c*c){
				ans2++;
			}
			else{
				ans3++;
			}
		}
	}
}

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

bool exist(int a,int b,int c){
    bool flag=false;
    if(a>0&&b>0&&c>0&&a+b>c&&a+c>b&&c+b>a)flag=true;
    return flag;
}
int type_check(int a,int b,int c){
    if(a*a+b*b==c*c)return 0;
    else if(c*c<b*b+a*a)return 1;
    else if(c*c>a*a+b*b)return 2;
    else return 3;
}

int main(){
    int c1=0,c2=0,c3=0,c4=0;
    int t_side[3];
    while(true){
        cin >> t_side[0]>>t_side[1]>>t_side[2];
        sort(t_side, t_side + 3, greater<int>());
        if(!exist(t_side[0],t_side[1],t_side[2]))break;
        switch(type_check(t_side[0],t_side[1],t_side[2])){
            case 0: c1++; break;
            case 1: c2++; break;
            case 2: c3++; break;
        }
        c4++;
    }
    cout <<c4<<" "<<c1<<" "<<c2<<" "<<c3<<endl;
    return 0;
}

C++: #include <iostream>
#include <bits/stdc++.h>
#include <string>
using namespace std;
int main(void){
    // Your code here!
    int a[3],t=0,c=0,e=0,d=0;
    for (int i=0;i<1000;i++){
        cin>>a[0]>>a[1]>>a[2];
        sort(a,a+3);
        if (a[2]>=a[0]+a[1])break;
        else if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1]){
            t+=1;
            c+=1;
        }
        else if(a[2]*a[2]>a[0]*a[0]+a[1]*a[1]){
            t+=1;
            d+=1;
        }
        else if(a[2]*a[2]<a[0]*a[0]+a[1]*a[1]){
            t+=1;
            e+=1;
        }
    }
    cout<<t<<" "<<c<<" "<<e<<" "<<d<<endl;
    return 0;
}