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>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int main(){
  int a=0,b=0,c=0,d=0;
  int p[3];
  while(~scanf("%d%d%d",p,p+1,p+2)){
    SORT(p,3)
    if(p[0] + p[1] <= p[2]){
      printf("%d %d %d %d\n",a,b,c,d);
      return 0;
     }
     
       a++;
       if(p[0]*p[0] + p[1]*p[1] == p[2] * p[2]) b++;
       if(p[0]*p[0] + p[1]*p[1] > p[2] * p[2]) c++;
       if(p[0]*p[0] + p[1]*p[1] < p[2] * p[2]) d++;
      
  }
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,a) for(int i = 0; i < (a); i++)
#define reps(i, a, b) for(int i = (a); i < (b); i++)
#define INF 1e9
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int, int> pii;
int main() {
	vi v = vi(3,0);
	vi ans = vi(4,0);
	while(cin >> v[0] >> v[1] >> v[2]) {
		sort(v.begin(), v.end());
		int v0 = v[0] * v[0], v1 = v[1] * v[1], v2 = v[2] * v[2];
		if(v[0] + v[1] > v[2]) ans[0]++;
		else break;
		if(v0 + v1 == v2) ans[1]++;
		if(v0 + v1 > v2) ans[2]++;
		if(v0 + v1 < v2) ans[3]++;
	}
	rep(i, 3) printf("%d ", ans[i]);
	printf("%d\n", ans[3]);
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a[3],w=0,x=0,y=0,z=0;
	while(cin>>a[0]>>a[1]>>a[2]){
		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++;
		w++;
	}
	cout<<w<<" "<<x<<" "<<y<<" "<<z<<endl;
    return 0;
    }

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

int main() {
    int x,y,z;
    int san,don,cho,ei;
    for(int i=0;;i++){
        cin >> x >> y >> z;
        int a = max(max(x,y),z),b,c;
        if(a == x) b=y,c=z;
        else if(a == y) b=z,c=x;
        else if(a == z) b=x,c=y;

        if(a >= b+c){ cout << san << ' ' << cho << ' ' << ei << ' ' << don << endl;
                    return 0;}

        else if(a*a > b*b + c*c){
            san++;
            don++;
        }
        else if(a*a == b*b + c*c){
            san++;
            cho++;
        }
        else if(a*a < b*b + c*c){
            san++;
            ei++;
        }
    }
}

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

int main(){
    
    int a,b,c;
    int s,ch,e,d;
    s = ch = 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{
            ch++;
        }
    }
    
    cout << s << " " << ch << " " << e << " " << d << endl;
    
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a[3];
	bool b = true;
	unsigned w, x, y, z;
	x = 0; y = 0; z = 0;
	while (cin >> a[0] >> a[1] >> a[2]) {
		if (b) {
			sort(a, a + 3);
			if (a[0] + a[1] < a[2])
				b = false;
			else 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++;
		}
	}
	cout << x + y + z << ' ' << x << ' ' << y << ' ' << z << endl;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>
using namespace std;
int a, b, c;
int cnt_a, cnt_b, cnt_c;
bool flag = true;
int main() {
	int i = 0;
	while (cin >> a >> b >> c, flag) {
		int maxV, minV, cen;
		maxV = max(a, max(b, c));
		minV = min(a, min(b, c));
		cen = a + b + c - minV - maxV;
		
		if (a + b > c&&a + c > b&&b + c > a) {
			if (minV*minV + cen * cen - maxV * maxV == 0) {
				cnt_b++; i++;
				continue;
			}
			 else if (minV*minV + cen * cen - maxV * maxV > 0) {
				cnt_a++; i++;
				continue;
			}
			
			else if (minV*minV + cen * cen - maxV * maxV < 0) {
				cnt_c++; i++;
				continue;
			}
		}else {
			flag = false;
		}
		if (!flag) break;
	}
	cout << i << " " << cnt_b << " " << cnt_a << " " << cnt_c << endl;
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a[3];
	bool b = true;
	unsigned w, x, y, z;
	w = 0; x = 0; y = 0; z = 0;
	while (cin >> a[0] >> a[1] >> a[2]) {
		if (b) {
			w++;
			sort(a, a + 3);
			if (a[0] + a[1] < a[2]){
				b = false;
			}
			else 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++;
		}
	}
	cout << w << ' ' << x << ' ' << y << ' ' << z << endl;
}

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

using namespace std;

int main()
{
	int a, b, c;
	int na, nb, nc, nd;
	
	na = nb = nc = nd = 0;
	while (1){
		scanf("%d %d %d", &a, &b, &c);
		if (a < b) swap(a, b); if (a < c) swap(a, c);
		if (a >= b + c) break;
		
		na++;
		if (b * b + c * c == a * a) nc++;
		else if (b * b + c * c < a * a) nd++;
		else nb++;
	}
	printf("%d %d %d %d\n", na, nc, nb, nd);
	
	return (0);
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a[3];
	bool b = true;
	int w, x, y, z;
	while (cin){
		if (b) {
			w++;
			sort(a, a + 3);
			if (a[0] + a[1] < a[2]){
				b = false;
			}
			else 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++;
		}
	}
	cout << w << ' ' << x << ' ' << y << ' ' << z << endl;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a[3];
	bool b = true;
	int w, x, y, z;
	while (cin >> a[0] >> a[1] >> a[2]) {
		if (b) {
			w++;
			sort(a, a + 3);
			if (a[0] + a[1] < a[2]){
				b = false;
			}
			else 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++;
		}
	}
	cout << w << ' ' << x << ' ' << y << ' ' << z << endl;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
//#define int long long
using namespace std;

int a[3];
int eikaku, tyokkaku, donkaku;

signed main()
{
	while (true) {
		rep(i,3) cin >> a[i];
		sort(a, a + 3);

		if (a[2] >= a[0] + a[1]) {
			cout << eikaku + tyokkaku + donkaku << " " << tyokkaku << " " << eikaku << " " << donkaku << endl;
			break;
		}

		if (a[0]*a[0] + a[1]*a[1] - a[2]*a[2] == 0) {
			tyokkaku++;
		} else if (a[0]*a[0] + a[1]*a[1] - a[2]*a[2] < 0) {
			donkaku++;
		} else {
			eikaku++;
		}
	}
}