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 <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF (1<<29)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
const int dx[] = {-1,0,0,1},dy[] = {0,1,-1,0};

typedef long long int ll;

using namespace std;

int main(){
    int choku,ei,don,no;
    choku = 0;
    ei = 0;
    don = 0;
    no = 0;
    while(true){
	int a,b,c;
	cin >> a >> b >> c;
	if(cin.eof()) break;
	if(a > c) swap(a,c);
	if(b > c) swap(b,c);
	if(a+b <= c) break;
	else{
	    a = a * a;
	    b = b * b;
	    c = c * c;
	    if(a + b == c) choku++;
	    else if(a + b < c) don++;
	    else if(a + b > c) ei++;
	}
    }
    printf("%d %d %d %d\n",choku+don+ei,choku,ei,don);
    return 0;
}

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

using namespace std;

int a[3];
int cnt[4];

int main(void){

	while(~scanf("%d%d%d",&a[0],&a[1],&a[2])){
		sort(a,a+3,greater<int>());
		if(a[1]+a[2]>a[0]){
			cnt[0]++;
			if(a[1]*a[1]+a[2]*a[2]==a[0]*a[0])cnt[1]++;
			else if(a[1]*a[1]+a[2]*a[2]>a[0]*a[0])cnt[2]++;
			else cnt[3]++;
		}else break;
	}
	printf("%d %d %d %d\n",cnt[0],cnt[1],cnt[2],cnt[3]);
	return 0;
}

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

using std::begin;
using std::end;

std::tuple<int, int, int> sort(int a, int b, int c) {
  int xs[] = {a, b, c};
  std::sort(begin(xs), end(xs));
  return std::make_tuple(xs[0], xs[1], xs[2]);
}

int main(int, char**) {
  int a, b, c;
  int cnt{0}, ei{0}, cho{0}, don{0};

  while(std::cin >> a >> b >> c) {
    auto t = sort(a, b, c);
    {
      int a, b, c;
      std::tie(a, b, c) = t;
      if(a + b == c) break;
      ++cnt;
      int m2 = a * a + b * b;
      if(m2 == c * c) ++cho;
      else if(m2 > c * c) ++ei;
      else ++don;
    }
  }

  std::cout << cnt << ' ' << cho << ' ' << ei << ' ' << don << std::endl;
}

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

int Solve(int a,int b,int c){

  if(c*c < a*a+b*b )return 1;
  if(c*c == a*a+b*b)return 0;
  else return 2;

}

int main(){

  int sum[]={0,0,0};
  vector< int > a(3);

  while(cin>>a[0]>>a[1]>>a[2]){
    sort(a.begin(),a.end());

    if(a[0]+a[1] > a[2]){
      sum[ Solve(a[0],a[1],a[2]) ] ++;
    }
    else{
      break;
    }

  }

  cout << sum[0]+sum[1]+sum[2] << ' ' << sum[0] << ' ' << sum[1] << ' ' << sum[2] << endl;

  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
const int N=3;

int main() {
  std::ios::sync_with_stdio(false);
  cout.tie(0); cin.tie(0);
  int Triangle=0,RightangledTriangle=0,AcuteangleTriangle=0,ObtuseTriangle=0;
  int threeSides[N];
  bool flag=true;
  while (flag) {
    cin>>threeSides[0]>>threeSides[1]>>threeSides[2];
    sort(threeSides,threeSides+N);
    if (threeSides[1]+threeSides[2]>threeSides[0]&&threeSides[0]+threeSides[2]>threeSides[1]&&threeSides[0]+threeSides[1]>threeSides[2]) {
      Triangle++;
      if (pow(threeSides[2],2)==pow(threeSides[0],2)+pow(threeSides[1],2)) {
	RightangledTriangle++;
      }
      else if (pow(threeSides[2],2)<pow(threeSides[0],2)+pow(threeSides[1],2)) {
	AcuteangleTriangle++;
      }
      else {
	ObtuseTriangle++;
      }
    }
    else flag=false;
  }
  cout<<Triangle<<" "<<RightangledTriangle<<" "<<AcuteangleTriangle<<" "<<ObtuseTriangle<<endl;
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <map>
#include <functional>
#include <cmath>
#include <cstdio>
using namespace std;

#define PI 4*atan(1);

int main(){
  int n[3], max = 0;
  int cnt[3] = {0}, ans = 0;
  while(1){
    //n[0]: 直角三角形, n[1]: 鋭角三角形, n[2], 鈍角三角形
    cin >> n[0] >> n[1] >> n[2];
    if(n[0] < n[1] + n[2] && n[1] < n[0] + n[2] && n[2] < n[0] + n[1]){
      sort(n, n + 3);
      int sum = n[0] * n[0] + n[1] * n[1] - n[2] * n[2];
      if(sum > 0){
        cnt[1]++;
        ans++;
      }else if(sum == 0){
        cnt[0]++;
        ans++;
      }else{
        cnt[2]++;
        ans++;
      }
    }else{
      cout << ans << " " << endl;
      for(int i = 0; i < 2; i++){
        cout << cnt[i] << " " << endl;
      }
      cout << cnt[2] << endl;
      break;
    }
  }

}

C++: #include <iostream>

using namespace std;

int main()
{
	int a[100], b[100], c[100],d,e,f,n;
	n = 0;
	d = 0;
	e = 0;
	f = 0;
	while (n <= 100)
	{
		cin >> a[n] >> b[n] >> c[n];
		if (a[n] + b[n] <= c[n] || a[n] + c[n] <= b[n] || b[n] + c[n] <= a[n])
			break;
		else
		{
			n++;
			if (a[n] * a[n] + b[n] * b[n] == c[n] * c[n] || a[n] * a[n] + c[n] * c[n] == b[n] * b[n] || b[n] * b[n] + c[n] * c[n] == a[n] * a[n])
			{
				d++;
			}
			if (a[n] * a[n] + b[n] * b[n] > c[n] * c[n] || a[n] * a[n] + c[n] * c[n] > b[n] * b[n] || b[n] * b[n] + c[n] * c[n] > a[n] * a[n])
			{
				e++;
			}
			else f++;
		}
	}
	cout << n<<" "<<d<<" "<<e<<" "<<f<<endl;
	return 0;
}