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 rep_(v, f, l) for (int v = (f), v##_ = (l); v < v##_; ++v)
#define rep(v, n) rep_(v, 0, n)
#define lep(v, n) rep_(v, 1, n + 1)
#define rrep_(v, f, l) for (int v = (l), v##_ = (f); v >= v##_; --v)
#define rrep(v, n) rrep_(v, 0, n - 1)
#define rlep(v, n) rrep_(v, 1, n)
#define show_a(a, size) rep(a##_it, size) std::cout << a[a##_it] << " \n"[a##_it == a##_it_ - 1];
#define show_v(v) show_a(v, v.size())
#define eachv(v, i) rep(i, v.size())
#define reachv(v, i) rrep(i, v.size())
#define debug(x) std::cerr << #x << " = " << x << "\n";

using namespace std;

typedef long long int lint;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }

bool is_triangle(int a, int b, int c){
    return (a < b + c && b < a + c && c < a + b);
}
bool is_right(int a, int b, int c){
    return a * a + b * b == c * c;
}
int get_type(int a, int b, int c){
    if (is_right(a, b, c) || is_right(b, c, a) || is_right(a, c, b)){
        return 1;
    }
    if (is_triangle(a * a, b * b, c * c)){
        return 2;
    }
    return 3;
}
int main()
{
    int bucket[4] = {};
    int a, b, c;
    while (~scanf("%d %d %d", &a, &b, &c)){
        if (is_triangle(a, b, c)){
            bucket[0]++;
            bucket[get_type(a, b, c)]++;
        }
        else break;
    }
    show_a(bucket, 4);
    return (0);
}

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

bool exist(int a,int b,int c){
    bool flag=false;
    if(a>0&&b>0&&c>0&&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==c*c+b*b)return 0;
    else if(a*a<b*b+c*c)return 1;
    else if(a*a>c*c+b*b)return 2;
    else return 3;
}
void max_sort(int t[]){
    for(int i=0;i<3;i++){
        if (t[0]<t[i]){
            int tmp=t[0];
            t[0]=t[i];
            t[i]=tmp;
        }
    }
}

int main(){
    int c1=0,c2=0,c3=0,c4=0;
    int t_side[3];
    while(true){
        cin >> t_side[0]>>t_side[1]>>t_side[2];
        max_sort(t_side);
        if(!exist(t_side[0],t_side[1],t_side[2]))break;
        switch(type_check(t_side[0],t_side[1],t_side[2])){
            case 0: c1++; break;
            case 1: c2++; break;
            case 2: c3++; break;
        }
        c4++;
    }
    cout <<c4<<" "<<c1<<" "<<c2<<" "<<c3<<endl;
    return 0;
}

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

int main(){
  int tri[4] = {};
  int l[3];
  
  while(cin >> l[0] >> l[1] >> l[2]){
    sort(l, l+3);
    if(l[0] + l[1] <= l[2]) break;
    
    tri[0]++;
    if(l[2]*l[2] == l[0]*l[0]+l[1]*l[1]) tri[1]++;
    if(l[2]*l[2] < l[0]*l[0]+l[1]*l[1]) tri[2]++;
    if(l[2]*l[2] > l[0]*l[0]+l[1]*l[1]) tri[3]++;
  }
  
  for(int i = 0 ; i < 4 ; i++){
    cout << tri[i];
    if(i == 3) cout << endl;
    else cout << " ";
  }
  return 0;
}

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

typedef unsigned int U4;
#define TRUE 1
#define FALSE 0

#define ACUTE_TRIANGLE 0
#define RIGHT_TRIANGLE 1
#define OBTUSE_TRIANGLE 2

U4 TrinagleNum = 0;
U4 AcuteTriangleNum = 0;
U4 RightTriangleNum = 0;
U4 ObtuseTriangleNum = 0;

U4 U4_TriangleCheck(U4,U4,U4);
U4 U4_TypeCheck(U4,U4,U4);
void V_LengthSort(U4*,U4*,U4*);
int main(void){

U4 a;
U4 b;
U4 c;

  while(1){
    cin >> a >> b >> c;
    if(U4_TriangleCheck(a,b,c) == TRUE){
      TrinagleNum++;
      if(U4_TypeCheck(a,b,c) == ACUTE_TRIANGLE){
        AcuteTriangleNum++;
      }else if(U4_TypeCheck(a,b,c) == OBTUSE_TRIANGLE){
        ObtuseTriangleNum++;
      }else{
        RightTriangleNum++;
      }
    }else{
      break;
    }
  }

  cout << TrinagleNum << " " << RightTriangleNum << " " << AcuteTriangleNum << " " << ObtuseTriangleNum << endl;
}

U4 U4_TriangleCheck(U4 a,U4 b,U4 c){
  if((a + b > c) && (b + c > a) && (c + a > b)){
    return TRUE;
  }else{
    return FALSE;
  }
}

U4 U4_TypeCheck(U4 a,U4 b,U4 c){
  U4 LongLength;
  U4 MiddleLength;
  U4 ShortLength;
  U4 LongLengthSquare;
  U4 MiddleLengthSquare;
  U4 ShortLengthSquare;

  LongLength   = a;
  MiddleLength = b;
  ShortLength  = c;

  V_LengthSort(&LongLength,&MiddleLength,&ShortLength);

  LongLengthSquare   = LongLength * LongLength;
  MiddleLengthSquare = MiddleLength * MiddleLength;
  ShortLengthSquare  = ShortLength * ShortLength;

  if(MiddleLengthSquare + ShortLengthSquare > LongLengthSquare){
    return OBTUSE_TRIANGLE;
  }else if(MiddleLengthSquare + ShortLengthSquare < LongLengthSquare){
    return ACUTE_TRIANGLE;
  }else{
    return RIGHT_TRIANGLE;
  }
}

void V_LengthSort(U4* Long,U4 *Middle,U4 *Short){
  U4 buff;

  if((*Long >= *Middle) && (*Long >= *Short)){
    // Do Nothing
  }else if(*Middle >= *Short){
    buff = *Long;
    *Long = *Middle;
    *Middle = buff;
  }else{
    buff = *Long;
    *Long = *Short;
    *Short = buff;
  }
}

C++: ans = [0 for i in range(4)]
while True:
  sides = sorted([int(inp) for inp in input().split()])
  if sides[2] >= sides[1] + sides[0]:
    print(ans[0], ans[1], ans[2], ans[3])
    break
  if sides[2]**2 > sides[1]**2 + sides[0]**2:
    ans[3]+=1
  elif sides[2]**2 == sides[1]**2 + sides[0]**2:
    ans[1]+=1
  else:
    ans[2]+=1
  ans[0]+=1

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

constexpr inline int square(int x) {
	return x * x;
}

int main() {
	int edge[3];
	int triangle = 0;
	int right	 = 0;
	int acute	 = 0;
	int obtuse	 = 0;

	while(scanf("%d %d %d", edge, edge + 1, edge + 2) == 3) {
		sort(edge, edge + 3);

		if(edge[0] + edge[1] <= edge[2]) {
			printf("%d %d %d %d\n", triangle, right, acute, obtuse);
			continue;
		}

		++triangle;
		const int a = square(edge[0]) + square(edge[1]);
		const int b = square(edge[2]);

		if(a == b) ++right;
		else if(a > b) ++acute;
		else ++obtuse;
	}

	return EXIT_SUCCESS;
}