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 <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);
    cout << A << " " << B << " " << C << endl;
    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 <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>


using namespace std;
typedef long long ll;

#define mod 1000000007
#define INF 2000000000
#define LLINF 4000000000000000000
#define SIZE 100

int main(){
    int a[3],ans1=0,ans2=0,ans3=0;
    
    while(1){
        scanf("%d%d%d",&a[0],&a[1],&a[2]);
        
        sort(a,a+3);
        
        if(a[0]+a[1] <= a[2]){
            printf("%d %d %d %d\n",ans1+ans2+ans3,ans1,ans2,ans3);
            return 0;
        }
        
        if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]){
            ans1++;
        
        }else if(a[0]*a[0]+a[1]*a[1] > a[2]*a[2]){
            ans2++;
        
        }else if(a[0]*a[0]+a[1]*a[1] < a[2]*a[2]){
            ans3++;
        }
        
        
    }
    
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define MOD (1000000007)
#define INF (1e9)
#define INFL (1e18)

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
template<class T>using arr=vector<vector<T>>;
template<class T>void pr(T x){cout << x << endl;}
template<class T>void prvec(vector<T>& a){rep(i, a.size()-1){cout << a[i] << " ";} cout << a[a.size()-1] << endl;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int type[3]={};
bool isTriangle(int a, int b, int c){
    if(a+b <= c || b+c <= a || c+a <= b) return false;
    return true;
}

void types(int a, int b, int c){
    a *= a;
    b *= b;
    c *= c;
    if(a+b == c || b+c == a || c+a == b) type[0]++;
    else if(a+b < c || b+c < a || c+a < b) type[2]++;
    else type[1]++;
}

int main()
{
    int a, b, c;
    
    while(cin >> a >> b >>c){
        if(!isTriangle(a,b,c)) break;
        types(a,b,c);
    }
    printf("%d %d %d %d\n", type[0] + type[1] + type[2], type[0], type[1], type[2]);
    return 0;}

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

int main() {
    int t1 = 0,
        t2 = 0,
        t3 = 0;
    vector<int> v(3);
    
    int i = 0;
    for ( ; ; i++) {
        cin >> v.at(0) >> v.at(1) >> v.at(2);
        sort(v.begin(), v.end());
        
        if ((v.at(0) + v.at(1)) <= v.at(2)) break;
        if (v.at(0) >= (v.at(1) + v.at(2))) break;
        if ((v.at(0) + v.at(2)) <= v.at(1)) break;
        
        if ((v.at(2) * v.at(2)) == (v.at(0) * v.at(0) + v.at(1) * v.at(1))) {
            t1++;
        } else if ((v.at(2) * v.at(2)) < (v.at(0) * v.at(0) + v.at(1) * v.at(1))) {
            t2++;
        } else if ((v.at(2) * v.at(2)) > (v.at(0) * v.at(0) + v.at(1) * v.at(1))) {
            t3++;
        }
    }
    //cout << v.at(0) << v.at(1) << v.at(2);
    cout << i << ' ';
    cout << t1 << ' ';
    cout << t2 << ' ';
  	cout << t3 << endl;
}

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;
            b=c;
            c=b;
        }
        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\n",count,right,acute,obtuse);
    return 0;
}

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

int main(){
    
    int a,b,c;
    int s,c,e,d;
    s = c = e = d = 0;
    
    while(1){
        cin >> a >> b >> c;
        if(a==0) break;
        s++;
        a=a*a;
        b=b*b;
        c=c*c;
        int hantei;
        if(a>b){
            if(a>c){
                hantei=a-b-c;
            }else{
                hantei=c-a-b;
            }
        }else{
            if(b>c){
                hantei=b-a-c;
            }else{
                hantei=c-a-b;
            }
        }
        if(hantei>0){
            d++;
        }else if(hantei<0){
            e++;
        }else{
            c++;
        }
    }
    
    cout << s << " " << c << " " << e << " " << d << endl;
    
    return 0;
}