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 <cmath>
using namespace std;


bool sankaku(int a, int b, int c) {
    int max_ = a;
    if (max_ < b) {
        max_ = b;
    }
    if (max_ < c) {
        max_ = c;
    }
    if (a + b + c - max_ > max_) {
        return true;
    }
    else {
        return false;
    }
}


int nani_sankaku(int a, int b, int c) {
    int hen[3] = {a, b, c};
    sort(hen, hen + 3);
    double ab = pow(hen[0], 2) + pow(hen[1], 2);
    double c_ = pow(hen[2], 2);
    if (ab > c_) {
        return 2;
    }
    if (ab == c_) {
        return 1;
    }
    if (ab < c_) {
        return 3;
    }

}


int main() {
    int ANS[4] = {0, 0, 0, 0};
    while (true) {
        int a;
        int b;
        int c;
        cin >> a >> b >> c;

        if (sankaku(a, b, c)) {
            ANS[nani_sankaku(a, b, c)]++;
            ANS[0]++;
        }
        else {
            cout << ANS[0] << ' ' << ANS[1] << ' ';
            cout << ANS[2] << ' ' << ANS[3] << '\n';
            return 0;
        }
    }
}

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

bool exist(int a,int b,int c){
    bool flag=false;
    if(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 1;
    else if(a*a<b*b+c*c)return 0;//鋭角
    else if(a*a>b*b+c*c)return 2;
    else return 3;
}

int main(){
    int a,b,c,c1=0,c2=0,c3=0,c4=0;
    while(true){
        cin >> a>>b>>c;

        if(!exist(a,b,c))break;
        switch(type_check(a,b,c)){
            case 0: c1++; break;
            case 1: c2++; break;
            case 2: c3++;break;
        }
        c4++;
    }
    cout <<c4<<" "<<c2<<" "<<c1<<" "<<c3<<" " <<endl;
}

C++: #include <bits/stdc++.h>
#define FOR(I,X,Y) for(int I=X;I<Y;I++)
#define REP(I,X,Y) for(int I=Y-1;I>=X;I--)
#define INF 1000000007
using namespace std;

int main(){
  int a,b,c;
  int ans1=0,ans2=0,ans3=0,ans4=0;
  while(1){
    cin >> a >> b >> c;
    if(b < a)swap(a,b);
    if(c < b)swap(b,c);
    if(c >= a+b)break;
    ans1++;
    if(a*a+b*b==c*c)ans2++;
    if(a*a+b*b>c*c)ans3++;
    if(a*a+b*b<c*c)ans4++;
  }
  cout << ans1 << " " << ans2 << " " << ans3 << " " << ans4 << endl;
}

C++: #include <bits/stdc++.h>
#define sqr(x) ((x) * (x))
using namespace std;
int a[3], p, q, r;
int main() {
    ios::sync_with_stdio(false);
    while(cin >> a[0] >> a[1] >> a[2]) {
        sort(a, a + 3);
        if(a[0] + a[1] <= a[2]) break;
        if(sqr(a[0]) + sqr(a[1]) == sqr(a[2])) p++;
        else if(sqr(a[0]) + sqr(a[1]) > sqr(a[2])) q++;
        else r++;
    }
    cout << p + q + r << ' ' << p << ' ' << q << ' ' << r << endl;
    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <ctime>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <numeric>
#include <cassert>
using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define mp(a,b,c) make_pair(make_pair(a,b),c)
#define pb(a) push_back(a)
#define SS stringstream
#define DBG1(a) rep(_X,sz(a)){printf("%d ",a[_X]);}puts("");
#define DBG2(a) rep(_X,sz(a)){rep(_Y,sz(a[_X]))printf("%d ",a[_X][_Y]);puts("");}
#define bitcount(b) __builtin_popcount(b)
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)

#define delete(a,n) a.erase(remove(all(a),n),a.end())
template<typename T, typename S> vector<T>& operator<<(vector<T>& a, S b) { a.push_back(b); return a; }
template<typename T> void operator>>(vector<T>& a, int b) {while(b--)if(!a.empty())a.pop_back();}
bool isprime(int n){ if(n<2)return false;  for(int i=2;i*i<=n;i++)if(n%i==0)return false;  return true;} 
ll b_pow(ll x,ll n){return n ? b_pow(x*x,n/2)*(n%2?x:1) : 1ll;}
string itos(int n){stringstream ss;ss << n;return ss.str();}

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

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<<endl;
}

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

int main(){
	int a=0,b=0,c=0;
	int e[3];
	while(scanf("%d%d%d", &e[0], &e[1], &e[2]) != EOF){
		sort(e, e+3);
		if(e[2] >= e[1]+e[0]) break;
		if(e[2]*e[2] == e[0]*e[0] +e[1]*e[1]) a++;
		if(e[2]*e[2] < e[0]*e[0] +e[1]*e[1]) b++;
		if(e[2]*e[2] > e[0]*e[0] +e[1]*e[1]) c++;
	}
	printf("%d %d %d %d\n", a+b+c, a, b, c);
	return 0;
}