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 d=0,e=0,f=0,g=0;
    for(;;){
       int a,b,c;
       cin>>a>>b>>c;
       if(a+b>c&&a+c>b&&b+c>a){
         if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a){
           e++;
         }
         else if(a*a+b*b<c*c||a*a+c*c<b*b||b*b+c*c<a*a){
                f++;
         }
         else{
             g++;
         }
         d++;
       }
       else{break;}
    }
    cout<<d<<" "<<e<<" "<<g<<" "<<f<<endl;
    return 0;
}

C++: 
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
using namespace std;
typedef long long unsigned int ll;

#define rep(i,n)for(i=0;i<n;i++)

#define INF (1e9)
#define PI  (acos(-1))




int main()
{
	int lines[3];
	int a = 0, b=0 , c=0, d=0;
	while(true){
		cin >> lines[0] >> lines[1] >> lines[2];
		sort(lines, lines + 3);

		int left = lines[0] * lines[0] + lines[1] *lines[1];
		if (lines[2] >= lines[0]+lines[1] ) {
			//三角形不成立
			cout << a << " " << b << " " << c << " " << d << endl;
			return(0);
		}else if (left == lines[2] *lines[2]) {
			//直角三角形
			a++;
			b++;
		}
		else if (left> lines[2] * lines[2]) {
			//鋭角三角形
			a++;
			c++;
		}
		else if (left < lines[2] * lines[2]) {
			//鈍角三角形
			a++;
			d++;
		}
	}

	return 0;


}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int a[3];
  int num_c = 0, num_e = 0, num_d = 0;
  for(;;){
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a + 3);
    if(a[0] + a[1] <= a[2]){
      cout << num_c + num_e + num_d << " " << num_c << " " << num_e << " " << num_d << endl;
      break;
    }else{
      if(a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) num_c++;
      else if(a[0] * a[0] + a[1] * a[1] > a[2] * a[2]) num_e++;
      else num_d++;
    }
  }
  return 0;
}

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

int main(){

  int a,b,c,tra=0,ei=0,ty=0,don=0,maxnum;

  while(1){

    cin >> a >> b >> c;
     
    maxnum = max(a,max(b,c));

    if(maxnum == b){
      b = a;
      a = maxnum;
    }
    else if(maxnum == c){
      c = a;
      a = maxnum;
    }

    if(a < (b + c) ){
      tra++;
      if(a*a > b*b + c*c){
        don++;
      }
      else if(a*a == b*b + c*c){
        ty++;
      }
      else{
        ei++;
      }
    }
    else{
      cout << tra << " " << ei << " " << ty << " " << don << endl;
      break;
    }
  }

  return 0;
}

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

const MAX = 10000;
int a[MAX];

BOOL IsRightAngle(int a, int b, int c){
    if(a*a == b*b + c*c) return TRUE;
    if(b*b == a*a + c*c) return TRUE;
    if(c*c == a*a + b*b) return TRUE;
    return FALSE;
}

BOOL IsOBTUSE(int a, int b, int c){
    if(a*a > b*b + c*c) return TRUE;
    if(b*b > a*a + c*c) return TRUE;
    if(c*c > b*b + a*a) return TRUE;
    return FALSE;
}

BOOL IsTriangle(int a, int b, int c){
    if(a+b > c) return TRUE;
    if(a+c > b) return TRUE;
    if(c+b > a) return TRUE;
    return FALSE;
}

void main(){
    for(int i = 0; i<MAX; i++){
        scanf( "%d" ,&a[i]):
    }
    int j = 0;]
    int tri = 0;
    int right = 0;
    int obtuse = 0;
    int acute = 0;
    for(;;){
        if( !IsTriangle(a[j],a[j+1],a[j+2]) ){
            break;
        }
        if( IsOBTUSE(a[j],a[j+1],a[j+2]) ){
            obtuse++;
            tri++;
        }
        else if(IsRightAngle(a[j],a[j+1],a[j+2]) ){
            right++;
            tri++;
        }
        else{
            acute++;
            tri++;
        }
        j += 3;
    }
    printf("%d %d %d %d\n",tri,right,acute,obtuse);
}

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

using namespace std;

int main(void){

  int a,b,c,res[4]={};

  while(cin >> a >> b >> c){
    
    if(a+b<=c || a+c<=b || b+c<=a){
      for(int i=0;i<4;i++){
	cout << res[i];
	if(i<3)cout <<" "; 
      }
      cout <<endl;
      break;
    }

    res[0]++;
    if(a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a)res[1]++;

    if(a*a+b*b>c*c && a*a+c*c>b*b && b*b+c*c>a*a)res[2]++;
    else if(a*a+b*b<c*c || a*a+c*c<b*b || b*b+c*c<a*a)res[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 <algorithm>

using namespace std;

int main() {

  int a[3];
  bool flg = 0;
  int ans[4] ={0};
  while(cin >>a[0] >> a[1] >> a[2]) {
   
    sort(a,a+3);

    if(a[0]+a[1] <= a[2] ) flg = 1;
    if(flg == 1) continue;

    
    if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]) ans[0]++;
    else if(a[0]*a[0]+a[1]*a[1] < a[2]*a[2]) ans[1]++;
    else ans[2]++;

    ans[3]++;

  }

  cout <<ans[3]<<" "<<ans[0]<<" "<<ans[2]<<" "<< ans[1]<<endl;
  return 0;
}