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 <vector>
#include <algorithm>
using namespace std;

int main() {
  int p,q,r,s;
  p = q = r = s = 0;
  int x,y,z;
  while(cin>>x>>y>>z) {
    vector<int> v(3);
    v[0] = x, v[1] = y, v[2] = z;
    sort(v.begin(), v.end());

    x = v[0], y = v[1], z = v[2];
    if (z >= x+y) {
      cout<<p<<" "<<q<<" "<<r<<" "<<s<<endl;
      break;
    }

    p++;
    if (x*x + y*y == z*z) {
      q++;
    } else if (x*x + y*y > z*z) {
      r++;
    } else {
      s++;
    }
  }
}

C++: #include <bits/stdc++.h>

using namespace std;

int a1,a2,a3,a4;

int main(){

	int a,b,c;
	int h[4];
	while(cin >> h[0] >> h[1] >> h[2]){
		sort(h,h+3);
		a = h[0];
		b = h[1];
		c = h[2];

		if(a+b > c){
			a1++;
			if(a*a + b*b == c*c)a2++;
			else if(a*a + b*b > c*c)a3++;
			else a4++;
		}else{
			printf("%d %d %d %d\n",a1,a2,a3,a4);
			break;
		}
	}
	return 0;
}

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

main(){
  int l[3], cnt[4];
  for ( int i = 0; i < 4; i++ ) cnt[i] = 0;

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

    sort(l, l+3);
    if ( l[0] + l[1] <= l[2] ) {
      for ( int i = 0; i < 4; i++ ){
	if ( i ) cout << " ";
	cout << cnt[i];
      }
      return 0;
    }

    cnt[0]++;
    if ( l[0]*l[0] + l[1]*l[1] == l[2]*l[2] ) cnt[1]++;
    else if  ( l[0]*l[0] + l[1]*l[1] < l[2]*l[2] ) cnt[3]++;
    else cnt[2]++;

  }
}

C++: #include<iostream>
using namespace std;
int main(){
	int i,x,y ,z,a,b,c,ch=0,ei=0,d=0;

	for(i=0;i<100;i++)
	{
		cin>>x>>y>>z;

		if(x>=y && y>=z) 
		{
			a=x;
			b=y;
			c=z;
		}
		else if(y>=x  && x>=z)
		{
			a=y;
			b=x;
			c=z;
		}
		else //(z>=x && x>=y)
		{
			a=z;
			b=y;
			c=x;
		}
		if(b+c<=a)
		{
			break;
		}               
		if (a*a<b*b+c*c)
		{
			ei+=1;
		}
		else if (a*a>b*b+c*c)
		{
			ch+=1;
		}
		else
		{
			d+=1;
		}
	}

	cout<<ch+d+ei<<" "<<ch<<" "<<ei<<" "<<d<<endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstring>
#include <cmath>
#include <cstdio>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

typedef long long ll;

int main(){
    int a,b,c;
    int d,e,f;
    d = e = f = 0;
    while(true){
        cin >> a >> b >> c;
        if(!(a < b + c && b < a + c && c < a + b)){
            break;
        }
        vector<int> vec;
        vec.push_back(a);
        vec.push_back(b);
        vec.push_back(c);
        sort(vec.begin(),vec.end());
        int p = vec[0] * vec[0] + vec[1] * vec[1];
        int g = vec[2];
        if(p == g*g){
            e++;
        }else if(p>g*g){
            d++;
        }else{
            f++;
        }
    }
    cout << d + e + f << " " << d <<  " " << e << " " << f << endl;
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int i,x,y ,z,a,b,c,ch=0,ei=0,d=0;

	for(i=0;i<100;i++)
	{
		cin>>x>>y>>z;

		if(x>=y && y>=z) 
		{
			a=x;
			b=y;
			c=z;
		}
		else if(y>=x  && x>=z)
		{
			a=y;
			b=x;
			c=z;
		}
		else //(z>=x && x>=y)
		{
			a=z;
			b=y;
			c=x;
		}

		if(b+c<=a)
		{
			break;
		}  

		a = a*a;
		b = b*b;
		c = c*c;

		if (a-(b+c)<0)
		{
			ei+=1;
		}

		if (a-(b+c)>0)
		{
			d+=1;
		}

		if(a == b+c)
		{
			ch+=1;
		}

		
	}

	cout<<ch+d+ei<<" "<<ch<<" "<<ei<<" "<<d<<endl;



	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstring>
#include <cmath>
#include <cstdio>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

typedef long long ll;

int main(){
    int a,b,c;
    int d,e,f;
    d = e = f = 0;
    while(true){
        cin >> a >> b >> c;
        if(!(a < b + c && b < a + c && c < a + b)){
            break;
        }
        vector<int> vec;
        vec.push_back(a);
        vec.push_back(b);
        vec.push_back(c);
        sort(vec.begin(),vec.end());
        int p = vec[0] * vec[0] + vec[1] * vec[1];
        int g = vec[2];
        if(p == g*g){
            d++;
        }else if(p>g*g){
            e++;
        }else{
            f++;
        }
    }
    cout << d + e + f << " " << d <<  " " << e << " " << f << endl;
    return 0;
}