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 c, a, 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 <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
using ll = long long;
using P = pair<int, int>;
using namespace std;

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    vector<double> abc(3);
    ll ans1=0, ans2=0, ans3=0, ans4=0;
    while (true) {
        rep(i, 3) cin >> abc[i];
        sort(abc.begin(), abc.end());
        double a=abc[0], b=abc[1], c=abc[2];
        if (c<b+a) {
            ans1++;
            double tmp = a*a+b*b-c*c;
            if (tmp == 0) ans2++;
            else if (tmp > 0) ans3++;
            else if (tmp < 0) ans4++;
        }
        else {
            break;
        }
    }
    cout << ans1 << ' ' << ans2 << ' ' << ans3 << ' ' << ans4 << endl;
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#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 == 1)
	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 <algorithm>
#include <iostream>
using namespace std;
int a[3], cnt, rt, at, ot, tmp;
int main() {
    while (cin >> a[0] >> a[1] >> a[2]) {
        sort(a, a + 3);
        if (a[0] + a[1] <= a[2]) {
            cout << cnt << " " << rt << " " << at << " " << ot << endl;
            return 0;
        }
        cnt++;
        tmp = a[0] * a[0] + a[1] * a[1] - a[2] * a[2];
        if (tmp == 0) rt++;
        if (tmp > 0) at++;
        if (tmp < 0) ot++;
    }
}

C++: #include <bits/stdc++.h>

using namespace std;

int v[3];

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

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

using namespace std;

int main(int argc, char const *argv[]) {
    int edge[3];
    int tri[3]={0};//0:right, 1:acute, 2:obtuse
    int total=0;

    while(1){
        for(int i=0;i<3;i++)
            cin >> edge[i];
        sort(edge,edge+3);
        if(edge[2] < edge[0] + edge[1]){
            total++;
            if(pow(edge[2],2) == pow(edge[0],2) + pow(edge[1],2)){
                tri[0]++;
            }else if(pow(edge[2],2) < pow(edge[0],2) + pow(edge[1],2)){
                tri[1]++;
            }else{
                tri[2]++;
            }
        }else{
            break;
        }
    }
    printf("%d %d %d %d\n",total,tri[0],tri[1],tri[2]);
    return 0;
}

C++: #include <stdio.h>
#include <algorithm>
#include <iostream>
#include <stack>
#include <vector>
#include <math.h>
#include <queue>

using namespace std;

int main(){

	int table[3],tyokkaku = 0,eikaku = 0,donkaku = 0;

	while(true){
		scanf("%d %d %d",&table[0],&table[1],&table[2]);

		for(int i = 1; i <=2; i++){
			for(int k =2; k >= i; k--){
				if(table[k] > table[k-1])swap(table[k],table[k-1]);
			}
		}

		if(table[0] + table[1] > table[2] && table[1]+table[2] > table[0] &&
				table[2] + table[0] > table[1]){
			if(table[0]*table[0] == table[1]*table[1]+table[2]*table[2])tyokkaku++;
			else if(table[0]*table[0] > table[1]*table[1]+table[2]*table[2]){
				donkaku++;
			}else{
				eikaku++;
			}
		}else{
			printf("%d %d %d %d\n",tyokkaku+eikaku+donkaku,tyokkaku,eikaku,donkaku);
			break;
		}
	}


    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,sum=0,ei=0,tyo=0,don=0;

  while(1){
    cin >> a >> b >> c;
    if(a > b){
      swap(a,b);
    }
    if(a > c){
      swap(a,c);
    }
    if(b > c){
      swap(b,c);
    }
    if( a+b <= c) break;
    sum++;
    if(c*c == a*a+b*b){
      tyo++;
    } else if(c*c > a*a+b*b){
      don++;
    } else if(c*c < a*a+b*b){
      ei++;
    }
  }
  cout << sum << " " << tyo << " " << ei << " " << don << endl;
  return 0;
}

C++: #include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int a[3], p, q, r;
int main() {
	while (true) {
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		if (a[0] + a[1] <= a[2]) { cout << p + q + r << ' ' << p << ' ' << q << ' ' << r << ' ' << endl; }
		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) { p++; }
		if (a[0] * a[0] + a[1] * a[1] > a[2] * a[2]) { q++; }
		if (a[0] * a[0] + a[1] * a[1] < a[2] * a[2]) { r++; }
	}
}

C++: #include <iostream>
#include <cstdio>
#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[2]>=a[0]+a[1]) break;
	
		if(a[2]*a[2] == a[0]*a[0]+a[1]*a[1]) ++x;
		else if(a[2]*a[2] < a[0]*a[0]+a[1]*a[1]) ++y;
		else ++z;
	
	}
	
	printf("%d %d %d %d\n", x+y+z, x, y, z);

	return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	int a,b,c;
	int d[3];
	int A,B,C;
	A=B=C=0;
	while(cin>>a>>b>>c){
		d[0]=a;
		d[1]=b;
		d[2]=c;
		sort(d,d+3);
		if(d[0]+d[1]<=d[2]){
			cout <<A+B+C<<" "<<A<<" "<<B<<" "<<C<<endl;
			return 0;
		}
		int D =(d[0]*d[0]+d[1]*d[1]);
		int E =(d[2]*d[2]);
		if(D==E){
			A++;
		}else if(D >E){
			B++;
		}else if(D <E){
			C++;
		}
	}
	return 0;
}