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>

using namespace std;

int main() {
	int a[3];
	int b, c, d;
	b = c = d = 0;
	while (cin >> a[0] >> a[1] >> a[2]) {
		for (int i = 2; i >= 0; i--) {
			for (int j = 0; j < i; j++) {
				if (a[j] > a[j+1]) {
					swap(a[j], a[j+1]);
				}
			}
		}
		if (a[0] + a[1] <= a[2]) {
			cout << b+c+d << ' ' << b << ' ' << c << ' ' << d << endl;
			while (cin >> a[0] >> a[1] >> a[2]) {
			}
			break;
		}
		if (a[0]*a[0] + a[1]*a[1] == a[2]*a[2]) {
			b++;
		} else if (a[0]*a[0] + a[1]*a[1] > a[2]*a[2]) {
			c++;
		}  else {
			d++;
		}
	}
	return 0;
}

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

int main(){
    
    int a,b,c;
    int s,ch,e,d;
    s = ch = e = d = 0;
    int tmp,hantei;
    while(1){
        cin >> a >> b >> c;
        if(a>b){
            if(a>c){
                tmp=a;
                a=c;
                c=tmp;
            }
        }else{
            if(b>c){
                tmp=b;
                b=c;
                c=tmp;
            }
        }
        if(c>=a+b) break;
        s++;
        hantei=c*c-a*a-b*b;
        if(hantei>0){
            d++;
        }else if(hantei<0){
            e++;
        }else{
            ch++;
        }
    }
    
    cout << s << " " << ch << " " << e << " " << d << endl;
    
    return 0;
}

C++: #include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

int main(){

	int x,y,z,s,a=0,b=0,c=0;
	for(;;){
	cin >> x >> y >> z;

	if(abs(x-z)<y && y<x+z){
	vector<int>t(3);
	t[0]=x; t[1]=y; t[2]=z;
	sort(t.begin(),t.end());

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

	}
	else{

		s=a+b+c;
		cout << s << " " << a << " " << b << " " << c << endl;
		break;
	}
	}

	return 0;
}

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

void sort( int* a )
{
    for( int i = 0; i < 2; i++ )
        for( int j = i + 1; j < 3; j++ )
            if( a[i] > a[j] )
            {
                int temp = a[i];
                a[i] = a[j];
                a[j] = temp;
            }
}

int main()
{
    int t[3];
    int t1 = 0, t2 = 0, t3 = 0, t4 = 0;

    while( cin >> t[0] >> t[1] >> t[2] )
    {
        sort( t );

        if( t[0] + t[1] > t[2] )                                            //三角形の存在条件
        {
            t1++;
            if( t[0] * t[0] + t[1] * t[1] == t[2] * t[2] )                  //直角三角形
                t2++;
            else if( t[0] * t[0] + t[1] * t[1] > t[2] * t[2] )              //鋭角三角形
                t3++;
            else                                                            //鈍角三角形
                t4++;
        }
        else
        {
            cout << t1 << " " << t2 << " " << t3 << " " << t4 << endl;
            break;
        }
    }
    return 0;
}

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

int main()
{
  int len[3];
  int type[3] = {0};

  while (~scanf("%d%d%d", &len[0], &len[1], &len[2])){
    sort(len, len + 3);

    if (len[0] + len[1] <= len[2]) break;
    else if (len[0] * len[0] + len[1] * len[1] == len[2] * len[2]){
      type[0]++;
    }
    else if (len[0] * len[0] + len[1] * len[1] > len[2] * len[2]){
      type[1]++;
    }
    else if (len[0] * len[0] + len[1] * len[1] < len[2] * len[2]){
      type[2]++;
    }
  }

  printf("%d %d %d %d\n", type[0] + type[1] + type[2], type[0], type[1], type[2]);

  return (0);
}

C++: #include <stdio.h>
#include <algorithm>

int main(){
    int inp[3], tyoku = 0, don = 0, ei = 0;
    for (int i = 0; i < 5; i++){
        scanf("%d %d %d",&inp[0], &inp[1], &inp[2]);
        sort(inp, inp + 3);
        
        if(inp[0] + inp[1] > inp[2]){
            int p = inp[0]*inp[0] + inp[1]*inp[1];
            int q = inp[2]*inp[2];
            if(p == q) tyoku++;
            else if(p < q) don++;
            else ei++;
        }
    }
    
    printf("%d %d %d %d¥n", tyoku +don +ei, tyoku,ei,don);
    return 0;
}

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

using namespace std;

int main(){
    int p[3];
    int donkaku=0,eikaku=0,tyokkaku=0;
    while(cin>>p[0]>>p[1]>>p[2]){
        sort(p,p+3);
        if(p[0]+p[1]<=p[2]){
            cout<<donkaku+eikaku+tyokkaku<<" "<<tyokkaku<<" "<<eikaku<<" "<<donkaku<<endl;break;
        }
        if(p[2]*p[2]<p[1]*p[1]+p[0]*p[0])eikaku++;
        else if(p[2]*p[2]>p[1]*p[1]+p[0]*p[0])donkaku++;
        else tyokkaku++;
        
    }
    return 0;
    
}

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

int main(){
  int a;
  int b;
  int c;
  int shahen;
  int hoge;
  int san_ei=0;
  int san_do=0;
  int san_ty=0;
  int san=0;
  
  for(;;){
    cin >> a >> b >> c;
    
    if(a<b){hoge=a; a=b; b=hoge;}
    if(a<c){hoge=a; a=c; c=hoge;}

    if(a+b>c && b+c>a && c+a>b){
      shahen=a*a;
      if(shahen==b*b+c*c){
	san_ty++;
      }else if(shahen>b*b+c*c){
	san_do++;
      }else if(shahen<b*b+c*c){
	san_ei++;
      }
      san++;
    }else{
      cout << san << " " << san_ty << " " << san_ei << " "  << san_do << "" << endl;
    break;
    }


  }
    
  return 0;
}

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

int main(){
	int a,b,c;
	int ca,cb,cc,cd;
	int l[3];
	while(cin>>l[0]>>l[1]>>l[2]){
		sort(l,l+3);
		a=l[0];
		b=l[1];
		c=l[2];
		if(c<a+b)
		ca++;
		
		if((a*a)+(b*b)==c*c)
		cb++;
		else if((a*a)+(b*b)>(c*c))
		cc++;
		else if((a*a)+(b*b)<(c*c))
		cd++;
		}
		cout<<ca<<" "<<cb<<" "<<cc<<" "<<cd<<endl;
		return 0;
	}

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

using namespace std;

int main() {
	
	int Length[3];
	
	while( cin >> Length[0] >> Length[1] >> Length[2]) {
		
	int Trinagle[4] = {};	
	sort(Length, Length+3);
	
	if( pow(Length[0], 2) + pow(Length[1], 2) == pow(Length[2], 3) )
	Trinagle[1]++;
	
	else if( pow(Length[0], 2) + pow(Length[1], 2) < pow(Length[2], 3) )
	Trinagle[2]++;
	
	else
	Trinagle[3]++;
	
	Trinagle[0] += ( Trinagle[1] + Trinagle[2] + Trinagle[3] ) ;
	cout << Trinagle[0] << " " << Trinagle[1] << " "
		 << Trinagle[2] << " " << Trinagle[3] << "\n";
}
	return 0;
}