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 <cstdio>
#include <cctype>
#include <utility>
#include <array>
using namespace std;

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _T template <typename T>
#define _HT template <typename H, typename... T>
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_T T in(int c){T n=0;bool m=false;while(isspace(c)){c=gcu();}if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m?-n:n;}
_in() {return in<int>(gcu());}
_T T scan(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_sc(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#endif
_HT _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
_vo(bool b) {pcu('0'+b);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_vo(string s){for(char c:s)pcu(c);}
#endif
_T _vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vl(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);outl();}
#endif
_HT _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	array<int, 3> l{};
	for (int a, b, c, n = 0; scan(a, b, c);) {
		if (a > b) swap(a, b);
		if (b > c) swap(b, c);
		double r = (a * a + b * b - c * c) / 2.0 / a / b;
		if (r > -1) {
			n++;
			if (r == 0)
				l[0]++;
			else if (r > 0)
				l[1]++;
			else
				l[2]++;
		} else {
			out(n);
			for (int x: l)
				out(' ' ,x);
			outl();
			break;
		}
	}
}

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

struct Triangle{
	int sides[3];
};

bool checkTriangle(const Triangle& t){
	for(int i=0;i<3;i++){
		if(t.sides[i] + t.sides[(i+1)%3] <= t.sides[(i+2)%3])return false;
	}
	return true;
}

bool checkRightTriangle(Triangle& t){
	std::sort(t.sides, t.sides+3);
	return (t.sides[0] * t.sides[0] + t.sides[1] * t.sides[1] == t.sides[2] * t.sides[2]);
}

bool checkObtuseTriangle(Triangle& t){
	double cos = 1.0 * (t.sides[0] * t.sides[0] + t.sides[1] * t.sides[1] - t.sides[2] * t.sides[2]) / (2 * t.sides[0] * t.sides[1]);
	return (cos < 0);
}

bool checkAcuteTriangle(Triangle& t){
	double cos = 1.0 * (t.sides[0] * t.sides[0] + t.sides[1] * t.sides[1] - t.sides[2] * t.sides[2]) / (2 * t.sides[0] * t.sides[1]);
	return (cos > 0);
}

int main(){
	int a, b, c, tn = 0, rtn = 0, otn = 0, atn = 0;
	bool ignored = false;
	while(std::cin >> a >> b >> c, !std::cin.eof()){
		if(ignored)continue;
		Triangle t = {{a, b, c}};
		if(checkTriangle(t)){
			tn++;
			if(checkRightTriangle(t))rtn++;
			if(checkObtuseTriangle(t))otn++;
			if(checkAcuteTriangle(t))atn++;
		}
		else ignored = true;
	}

	printf("%d %d %d %d\n", tn, rtn, atn, otn);
}

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

int a, b, c;
int n[4];

int main(){
	while(true){
		scanf("%d %d %d", &a, &b, &c);
		if(a > b) swap(a, b);
		if(b > c) swap(b, c);
		if(a + b <= c) break;
		++n[0];
		if(a*a + b*b < c*c) ++n[3];
		else if(a*a + b*b == c*c) ++n[1];
		else ++n[2];
	}
	printf("%d %d %d %d\n", n[0], n[1], n[2], n[3]);
}

C++: #include<cstdio>
int main(void){
    
    int a=0,b=0,c=0;
    int change=0;
    int right=0,obtuse=0,acute=0;
    int value=0,check=0,count=0;
    int flag=true;
    while(flag){
        count++;
        scanf("%d%d%d",&a,&b,&c);
        if(c<a){
            change=a;
            a=c;
            c=a;
        }
        if(c<b){
            change=b;
            a=b;
            b=a;
        }
        check=a+b-c;
        value=a*a+(b*b-c*c);
        if(check<=0){
            break;
        }
        if(value==0){
            right++;
        }
        else if(value<0){
            obtuse++;
        }
        else{
            acute++;
        }
    }
    printf("%d %d %d %d",count,right,acute,obtuse);
    return 0;
}

C++: #include<cstdio>
int main(void){
    
    int a=0,b=0,c=0;
    int change=0;
    int right=0,obtuse=0,acute=0;
    int value=0,check=0,count=0;
    int flag=true;
    while(flag){
        count++;
        scanf("%d%d%d",&a,&b,&c);
        if(c<a){
            change=a;
            a=c;
            c=change;
        }
        if(c<b){
            change=b;
            b=c;
            c=change;
        }
        check=a+b-c;
        value=a*a+b*b-c*c;
        if(check<=0){
            break;
        }
        
        if(value==0){
            right++;
        }
        if(value<0){
            obtuse++;
        }
        if(value>0){
            acute++;
        }
    }
    printf("%d %d %d %d\n",count,right,acute,obtuse);
    return 0;
}