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 a, b, c;
  int ansn = 0, ans1 = 0, ans2 = 0, ans3 = 0;
  while (cin >> a >> b >> c) {
    if (a + b > c && b + c > a && c + a > b) {
      ansn++;

      if (a < b) {
        int swap = a;
        a = b;
        b = swap;
      }
      if (a < c) {
        int swap = a;
        a = c;
        c = swap;
      }

      int A = b * b + c * c - a * a;

      if (A == 0) ans1++;
      else if (A > 0) ans2++;
      else ans3++;
    } else break;
  }

  cout << ansn << " " << ans1 << " " << ans2 << " " << ans3 << endl;

  return 0;
}

C++: #include<stdio.h>
#include<algorithm>
int p[3];
using namespace std;
int main(){
	int a=0,b=0,c=0,d=0;
	while(~scanf("%d%d%d",p,p+1,p+2)){
		std::sort(p,p+3);
		if(p[0]+p[1]<=p[2]){
			printf("%d %d %d %d\n",a,b,c,d);
			return 0;
		}
		a++;
		if(p[0]*p[0]+p[1]*p[1]==p[2]*p[2])b++;
		if(p[0]*p[0]+p[1]*p[1]>p[2]*p[2])c++;
		if(p[0]*p[0]+p[1]*p[1]<p[2]*p[2])d++;
	}
}

C++: // ------------------------------------
// Date:2018/ 2/20
// Problem:AOJ 0582 TriangleTypes 0582.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define POW(n) (n)*(n)

int main()
{
  int acute,right,obtuse;
  acute = right = obtuse = 0;
  vector<int> length(3,0);
  while(scanf("%d %d %d",&length[0],&length[1],&length[2]) != EOF) {
    sort(ALL(length));
    if (length[2] >= length[0] + length[1]) break;
    else if (POW(length[2]) < POW(length[0]) + POW(length[1])) ++acute;
    else if (POW(length[2]) == POW(length[0]) + POW(length[1])) ++right;
    else ++obtuse;
  }
  printf("%d %d %d %d\n", acute+right+obtuse, right, acute, obtuse);
  return 0;
}

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

int main() {
  int o0 = 0, o1 = 0, o2 = 0, o3 = 0; // 全三角形, 鋭角, 直角, 鈍角のカウンタ
  while (true) {
    int a, b, c;
    cin >> a >> b >> c;
    // aを最長とする
    if (a < b) {
      int temp = b;
      b = a;
      a = temp;
    }
    if (a < c) {
      int temp = c;
      c = a;
      a = temp;
    }
    if (fabs(b - c) < a && a < b + c) {
      o0++;
      // 余弦定理から判定
      if (a * a > b * b + c * c) {
	o3++;
      } else if (a * a < b * b + c * c) {
	o1++;
      } else {
	o2++;
      }
    } else {
      // 終了
      break;
    }
  }
  cout << o0 << " " << o2 << " " << o1 << " " << o3 << endl;
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
signed main(){
int a[3];
int k[3]{};
while(1){
    scanf("%d%d%d",&a[0],&a[1],&a[2]);
    sort(a,a+3);
    if(a[0]+a[1]<=a[2])break;
    if(a[0]*a[0]+a[1]*a[1]<a[2]*a[2])k[0]++;
    else if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])k[1]++;
    else k[2]++;
    }
    printf("%d %d %d %d\n",k[0]+k[1]+k[2],k[1],k[2],k[0]);
}

C++: #include<iostream>
#include<string>
#include<algorithm>
 
using namespace std;
 
int main()
{
	int tris = 0;
	int right_tris = 0;
	int acute_tris = 0;
	int obtuse_tris = 0;
	for( int i = 0; i < 100; i ++)
	{
		int a, b, c;
		cin >> a >> b >> c;

		if( a + b > c && b + c > a && c + a > b )
		{
			tris ++;

			int d = b * b + c * c;
			int aa = a * a;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				acute_tris ++;
				continue;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
			d = c * c + a * a;
			aa = b * b;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				acute_tris ++;
				continue;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
			d = a * a + b * b;
			aa = c * c;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				acute_tris ++;
				continue;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
		}
	}

	cout << tris << " " << right_tris << " " << acute_tris << " " << obtuse_tris << endl;

	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;
    return 0;
}

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

int main(){
	int d[3],sum,tyokkaku=0,eikaku=0,donnkaku=0;
	while(true){
		for(int i=0;i<3;i++)cin>>d[i];
		sort(d,d+3);
		if(d[2]>=d[0]+d[1])break;
		else if(d[2]*d[2]==d[0]*d[0]+d[1]*d[1])tyokkaku++;
		else if(d[2]*d[2]<d[0]*d[0]+d[1]*d[1])eikaku++;
		else donnkaku++;
	}
	sum=tyokkaku+eikaku+donnkaku;
	cout<<sum<<" "<<tyokkaku<<" "<<eikaku<<" "<<donnkaku<<endl;
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <algorithm>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

int cnt[3];
int as[3];

int main()
{
  while( true )
  {
    int a, b, c;
    scanf( "%d%d%d", &a, &b, &c );

    as[0] = a, as[1] = b, as[2] = c;

    std::sort( as, as+3 );

    if( abs(a-b) < c && c < a+b )
    {
      int py = as[2]*as[2]-as[0]*as[0]-as[1]*as[1];

      if( py == 0 )
        ++cnt[0];
      else if( py < 0 )
        ++cnt[1];
      else
        ++cnt[2];
    }
    else
    {
      printf( "%d %d %d %d\n", cnt[0]+cnt[1]+cnt[2], cnt[0], cnt[1], cnt[2] );

      return 0;
    }
  }
  
  return 0;
}

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

int main() {
  int a, b, c, x, count , p, q, r;
  count = p = q = r = 0;
  
  while(1){
    cin >> a >> b >> c;
    if (a < b) {
      x = a;
      a = b;
      b = x;
    }
    if (b < c) {
      x = b;
      b = c;
      c = x;
    }
    if (a < b) {
      x = a;
      a = b;
      b = x;
    }
    
    if (b + c > a){
      if (b*b + c*c == a*a) {
        p++;
      } else if (b*b + c*c > a*a) {
        q++;
      } else {
        r++;
      }
      count++;
    } else {
      break;
    }
  }
  cout << count << " " << p << " " << q << " " << r << endl;
  
  return 0;
  
}