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>
#include <algorithm>
using namespace std;

int main() {
    int a, b, c;
    int tri=0, sharp=0, obtuse=0, right=0;
    while(cin>>a>>b>>c) {
        int temp = max({a, b, c});
        if(temp==b) {
            swap(a, b);
        } else if(temp==c) {
            swap(a, c);
        }
        if(a>=b+c) break;
        tri++;
        int d = b*b+c*c-a*a;
        if(d==0) right++;
        else if(d>0) sharp++;
        else obtuse++;
    }
    cout << tri << ' ' << right << ' ' << sharp << ' ' << obtuse << '\n';

    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n;
	int a[100],b[100],c[100];
	int d,e,f;
	int s;
	int i;
	int flg[100];
	int cnt,cnt1,cnt2,cnt3;
	int max;
	cnt=cnt1=cnt2=cnt3=0;
	
	for(i=0;i<5;i++){
		scanf("%d %d %d",&a[i],&b[i],&c[i]);
	}
	for(i=0;i<5;i++){
		d=a[i]*a[i];
		e=b[i]*b[i];
		f=c[i]*c[i];
		if(c[i]>=a[i] && c[i]>=b[i] && c[i]<a[i]+b[i] || b[i]>=a[i] && b[i]>=c[i] && b[i]<c[i]+a[i] || a[i]>=c[i] && a[i]>=b[i] && a[i]<b[i]+c[i]){
			cnt++;
			if(c[i]>=a[i] && c[i]>=b[i]){
				s=f-d-e;
				if(s==0){
					cnt1++;
				}
				else if(s<0){
					cnt2++;
				}
				else if(s>0){
					cnt3++;
				}
			}
			else if(b[i]>=a[i] && b[i]>=c[i]){
				s=e-d-f;
				if(s==0){
					cnt1++;
				}
				else if(s<0){
					cnt2++;
				}
				else if(s>0){
					cnt3++;
				}
			}
			else if(a[i]>=c[i] && a[i]>=b[i]){
				s=d-f-e;
				if(s==0){
					cnt1++;
				}
				else if(s<0){
					cnt2++;
				}
				else if(s>0){
					cnt3++;
				}
			}
		}
		else if(c[i]>=a[i] && c[i]>=b[i] && c[i]>=a[i]+b[i] || b[i]>=a[i] && b[i]>=c[i] && b[i]>=c[i]+a[i] || a[i]>=c[i] && a[i]>=b[i] && a[i]>=b[i]+c[i]){
			break;
		}
	}
	printf("%d %d %d %d\n",cnt,cnt1,cnt2,cnt3);
	return 0;
}

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

using namespace std;

int data[3];
int ans[4];

int main(){

  
  while(cin >> data[0] >> data[1] >> data[2]){
    sort(data,data+3);
    if(data[0] + data[1] <= data[2]) break;
    ans[0]++;

    int tmp = data[0]*data[0]+data[1]*data[1];

    if(tmp > data[2]*data[2]) ans[1]++;
    if(tmp == data[2]*data[2]) ans[2]++;
    if(tmp < data[2]*data[2]) ans[3]++;
  }

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a, b, c;
  int p = 0, q = 0, r = 0, s = 0;
  while(scanf("%d %d %d\n", &a, &b, &c)){
    int maxx = a;
    if(maxx < b) maxx = b;
    if(maxx < c) maxx = c;
    if( 2 * maxx < a + b + c ) {
      p++;
      if(2 * pow(maxx, 2) == a*a + b*b + c*c) q++;
      else if(2 * pow(maxx,2) < a*a + b*b + c*c) r++;
      else s++;
    }
  }
  printf("%d %d %d %d\n", p, q, r ,s);

  return 0;
}

C++: #include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int cnt;
	int a,b,c;
	a = b = c = cnt = 0;
	while(true){
		int A[5];
		for(int i = 0; i < 3; i++){
			int tmp;
			scanf("%d",&tmp);
			A[i] = tmp;
		}
		sort(A,A+3);
		if(A[2] >= A[1] + A[0])break;
		cnt++;
		if(A[0]*A[0] + A[1]*A[1] == A[2]*A[2])a++;
		else if(A[0]*A[0] + A[1]*A[1] > A[2]*A[2])b++;
		else if(A[0]*A[0] + A[1]*A[1] < A[2]*A[2])c++;
	}
	printf("%d %d %d %d\n",cnt,a,b,c);
	return 0;
}

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

enum{TRIANGLE, RIGHT, ACUTE, OBTUSE, N};

int main()
{
    vector<int> count(N, 0);
    vector<int> edge(3);
    while(cin>>edge[0]>>edge[1]>>edge[2]) {
        sort(edge.begin(), edge.end(), greater<int>());

        if(edge[0] < edge[1] + edge[2]) {
            count[TRIANGLE]++;
        } else {
            cout<<count[TRIANGLE];
            for(int i=1; i<N; i++) cout<<" "<<count[i];
            cout<<endl;
            break;
        }

        int d = edge[0]*edge[0] - edge[1]*edge[1] - edge[2]*edge[2];
        if(d == 0) {
            count[RIGHT]++;
        } else if(d < 0) {
            count[ACUTE]++;
        } else if(d > 0) {
            count[OBTUSE]++;
        }
    }
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

void sort(int *a, int *b, int *c){
  int tmp;
  if(*a == max(*a, max(*b, *c))){
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }else if(*b == max(*b, *c)){
    tmp = *a, *a = *b, *b = tmp;
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }else{
    tmp = *a, *a = *c, *c = tmp;
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }
}

int judge(int a, int b, int c){ // 1:直角三角形 2:鋭角三角形 3:鈍角三角形
  if(SQ(a) == SQ(b) + SQ(c)) return 1;
  if(SQ(a) < SQ(b) + SQ(c)) return 2;
  if(SQ(a) > SQ(b) + SQ(c)) return 3;
  return 0;
}

int main(){
  int A, B, C;
  ll res[4];
  memset(res, 0, sizeof(res));
  while(cin >> A >> B >> C){
    sort(&A, &B, &C);
    if(A >= B + C) break;
    res[0]++;
    res[judge(A, B, C)]++;
  }

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

C++: #include<bits/stdc++.h>
using namespace std;
main(){
  int tri[3];
  int s = 0, e = 0, t = 0, d = 0;
  while (cin>>tri[0]>>tri[1]>>tri[2]){
    sort(tri,tri+3);
    if (tri[2]>=tri[0]+tri[1]) break;
    s++;
    if (tri[2]*tri[2]==tri[0]*tri[0]+tri[1]*tri[1]) t++;
    if (tri[2]*tri[2]>tri[0]*tri[0]+tri[1]*tri[1]) d++;
    if (tri[2]*tri[2]<tri[0]*tri[0]+tri[1]*tri[1]) e++;
  } 
  cout <<s<<" "<<t<<" "<<e<<" "<<d<< endl;
  return 0;
}