Go: ///
// File:  0582.go
// Author: ymiyamoto
//
// Created on Wed Feb 28 22:51:48 2018
//
package main

import (
	"bufio"
	"fmt"
	"os"
)

const (
	steep = iota
	orth
	obtuse
)

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

func triangle(a, b, c int) int {
	if a*a == b*b+c*c {
		return orth
	} else if b*b+c*c-a*a > 0 {
		return steep
	} else {
		return obtuse
	}
}

func main() {
	s := bufio.NewScanner(os.Stdin)

	var num, st, or, ob int
	for s.Scan() {
		var a, b, c int
		fmt.Sscan(s.Text(), &a, &b, &c)

		m, n1, n2 := max(a, b, c)
		if m < n1+n2 {
			switch triangle(m, n1, n2) {
			case steep:
				st++
			case orth:
				or++
			case obtuse:
				ob++
			}
			num++
		} else {
			break
		}
	}
	fmt.Println(num, or, st, ob)
}

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

C++: #include <stdio.h>
#include <math.h>
 
int main(){
    int a,b,c;
    int e=0,t=0,d=0;
    int s=0;
 
    while(1){
	scanf("%d %d %d" ,&a ,&b ,&c);
	if((fabs(a-b) < c && a + b > c)){
	    s++;
	    if((a*a + b*b < c*c)||(a*a + c*c < b*b) ||(b*b + c*c < a*a) ) d++;
	    else  if((a*a + b*b == c*c) ||( a*a + c*c == b*b) || (b*b + c*c == a*a) ) t++;
	    else if((a*a + b*b > c*c) ||(a*a + c*c > b*b) ||(b*b + c*c > a*a)) e++;
	}
	else break;
    }
    printf("%d %d %d %d\n" ,s ,t ,e ,d);
    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(b);i>(a);--i)
#define eper(i,a,b) for(int i=((int)(a));i>=b;--i)
#define pb push_back
#define mp make_pair
#define INF (1<<28)-1
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int> Pii;
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 dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}

int rght, acute, obtuse;
bool flag = false;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
    int e[3];
    while (true) {
        rep(i, 0, 3) cin >> e[i];
        sort(e, e+3);
        int a = e[0], b = e[1], c = e[2];
        if (a + b <= c) {
            printf("%d %d %d %d\n", rght+acute+obtuse, rght, acute, obtuse);
            break;
        }
        if (a * a + b * b == c * c) rght++;
        else if (a * a + b * b > c * c) acute++;
        else obtuse++;
    }
    return 0;
}