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<iostream>
using namespace std;
int main(){
    int a,b,c,l=0,m=0,n=0,o=0;
    while(1){
         cin>>a>>b>>c;
         if(a+b>c&&b+c>a&&a+c>b){
           l+=1;
           if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a){
             m+=1;
           }
           int j=0;
           if(j<a){
           j+=a;
           }
           if(j<b){
           j+=b;
           }
           if(j<c){
           j+=c;
           }
           if(j==a){
             if(a*a<b*b+c*c){
               n+=1;
             }
             else  if(a*a>b*b+c*c){
               o+=1;
             }
           }
           else if(j==b){
             if(b*b<a*a+c*c){
               n+=1;
             }
           else  if(b*b>a*a+c*c){
               o+=1;
             }
           }
           else{
                  if(c*c<b*b+a*a){
                    n+=1;
                  }
                  else if(c*c>b*b+a*a){
                    o+=1;
                  }
           }
         }
         else{break;}
     }
     cout<<l<<" "<<m<<" "<<n<<" "<<o<<endl;
     return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
 
using namespace std;
 
int main()
{
	int tris = 0;
	int right_tris = 0;
	int acute_tris = 0;
	int obtuse_tris = 0;
	for( int i = 0; i < 100; i ++)
	{
		int a, b, c;
		cin >> a >> b >> c;

		if( a == 0 )
		{
			cout << tris << " " << right_tris << " " << acute_tris << " " << obtuse_tris << endl;
			return 0;
		}

		if( a + b > c && b + c > a && c + a > b )
		{
			tris ++;

			int d = b * b + c * c;
			int aa = a * a;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				acute_tris ++;
				continue;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
			d = c * c + a * a;
			aa = b * b;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				acute_tris ++;
				continue;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
			d = a * a + b * b;
			aa = c * c;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				acute_tris ++;
				continue;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
		}
	}

	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int cho, ei, don;
	cho = ei = don = 0;
	for (int a, b, c; cin >> a >> b >> c;) {
		vector<int> v{ a,b,c };
		sort(all(v));
		a = v[0], b = v[1], c = v[2];
		if (a + b <= c)break;
		if (a*a + b*b == c*c)cho++;
		else if (a*a + b*b > c*c)ei++;
		else don++;
	}
	cout << cho + ei + don << " " << cho << " " << ei << " " << don << endl;
	return 0;
}

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

using namespace std;

int main() {
	
	int Length[3];
	int Triangle[4] = {};
	bool flag = 0;
	
	while( cin >> Length[0] >> Length[1] >> Length[2]) {
	
	sort(Length, Length+3);
	
	if( Length[0] + Length[1] <= Length[2] ) flag = 1;
	if(flag == 1) continue;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) == pow(Length[2], 2) )
	Triangle[1]++;
	
	else if( pow(Length[0], 2) + pow(Length[1], 2) < pow(Length[2], 2) )
	Triangle[2]++;
	
	else
	Triangle[3]++;
	
	}
	Triangle[0] += ( Triangle[1] + Triangle[2] + Triangle[3] );
	cout << Triangle[0] << " " << Triangle[1] << " "
		 << Triangle[2] << " " << Triangle[3] << "\n";
	return 0;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
int main(){
    int a[3],x=0,y=0,z=0;
    while(scanf("%d%d%d",&a[0],&a[1],&a[2])!=EOF){
        sort(a,a+3);
        if(a[0]+a[1]<=a[2])break;
        if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])x++;
        else if(a[0]*a[0]+a[1]*a[1]<a[2]*a[2])y++;
        else z++;
    }
    printf("%d %d %d %d\n",x+y+z,x,z,y);
}

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

int main() {
	int a, b, c;
	a = b = c = 0;
	while (1) {
		int k[3];
		for (int d = 0; d < 3; d++)cin >> k[d];
		sort(k, k + 3);
		if (k[0] + k[1] <= k[2]) { printf("%d %d %d %d\n", a + b + c, b, a, c); return 0; }
		int e = k[0] * k[0] + k[1] * k[1], f = k[2] * k[2];
		if (e > f)a++;
		else if (e == f)b++;
		else c++;
	}
}

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

using namespace std;

int main() {
	
	int Length[3];
	int Triangle[4] = {};
	bool flag = 0;
	
	while(scanf("%d %d %d", &Length[0], &Length[1], &Length[2]) != EOF) {
	
	sort(Length, Length+3);
	
	if( Length[0] + Length[1] <= Length[2] ) 
		flag = 1;
		
	if(flag)
	continue;

	
	Triangle[0]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) == pow(Length[2], 2) )
	Triangle[1]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) < pow(Length[2], 2) )
	Triangle[2]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) > pow(Length[2], 2) )
	Triangle[3]++;
	
	}
	cout << Triangle[0] << " " << Triangle[1] << " "
		<< Triangle[2] << " " << Triangle[3] << "\n";
	return 0;
}

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

int san = 0;
int a[3];
int inu = 0;
int saru = 0;
int kiji = 0;

int main(){
	while (true){
		for (int i = 0; i < 3; i++){
			cin >> a[i];
		}
		sort(a, a + 3);
		if (a[3] * a[3] < a[2] * a[2] + a[1] * a[1] && a[3] < a[1] + a[2]){
			san = san + 1;
			saru = saru + 1;
		}if (a[3] * a[3] == a[2] * a[2] + a[1] * a[1] && a[3] < a[1] + a[2]){
			san = san + 1;
			inu = inu + 1;
		}if (a[3] * a[3] > a[2] * a[2] + a[1] * a[1] && a[3] < a[1] + a[2]){
			san = san + 1;
			kiji = kiji + 1;
		}if (a[3] > a[1] + a[2]){
			break;
		}
	}
	cout << san << " " << inu << " " << saru << " " << kiji << endl;
}

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

int main() {
	int a, b, c;
	int tri = 0;
	int acte = 0;
	int right = 0;
	int obtuse = 0;
	vector<int> t(3);
	while (cin >> a >> b >> c) {
		t[0] = a;
		t[1] = b;
		t[2] = c;
		sort(t.begin(), t.end());
		a = pow(t[0], 2);
		b = pow(t[1], 2);
		c = pow(t[2], 2);
		if (t[0] + t[1] > t[2]) {
			tri++;
			if (a + b == c) {
				right++;
			}
			else if (a + b > c){
				acte++;
			}
			else if (a + b < c) {
				obtuse++;
			}
		}
	}
	cout << tri << " " << right << " " << acte << " " << obtuse << endl;
	return 0;
}