Go: package main
// 三角形の形は辺の長さで決まる． 順番に３つの正整数が与えられたとき， 辺の長さがそれらの値と一致する三角形が存在するかどうかを調べ,
//  存在するなら鋭角三角形，直角三角形，鈍角三角形のいずれかを判定し， 次の入力へ進む． 三角形が存在しないとき， それまでに入力された，
// 三角形，直角三角形，鋭角三角形，鈍角三角形の 個数を空白で区切って出力し， それ以降の入力は無視して終了する
// 入力の中には必ず三角形が存在しないようなものがある と仮定してよい. 入力の行数は判らないが各行には３つの正整数が空白で区切って書かれている．
//  ただし，各整数は100 以下とする.

// return
// 三角形 直角三角形　鈍角三角形 鈍角三角形
import (
	"os"
	"fmt"
	"bufio"
)


var sc = bufio.NewScanner(os.Stdin)

func max(a, b, c int) (int, int, int) {
	if a > b {
		if b > c {
			return a, b, c
		} else {
			return a, c, b
		}
	} else {
		if b > c {
			return b, a, c
		} else {
			return c, b, a
		}
	}
}

func find_trianges(a, b, c int) string {
	a, b, c = max(a, b, c)
	r := b*b + c*c
	if a*a > r {
		return "obtuse_triangle"
	} else if a*a < r {
		return "sharped_triangle"
	} else {
		return "right_triangle"
	}
}

func main() {
	s := bufio.NewScanner(os.Stdin)
	var t, r_t, s_t, o_t int = 0, 0, 0, 0
	for s.Scan() {
		var a, b, c int
		fmt.Sscan(s.Text(), &a, &b, &c)
			a, b, c = max(a, b, c)
			if (a < b + c) {
				r := find_trianges(a, b, c)
				switch r {
				case "right_triangle":
					r_t++
				case "sharped_triangle":
					s_t++
				case "obtuse_triangle":
					o_t++
				}
				t++
			}	else {
				break
			}
			
	}
	fmt.Println(t, r_t, s_t, o_t)
}

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