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 <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;

int main(){
    int a;
    int b;
    int c;
    int t=0;
    int e=0;
    int d=0;
    int all=0;
    while(1){
        cin>>a>>b>>c;
        if(a+b<c||a+c<b||b+c<a){
            cout<<all<<" "<<t<<" "<<e<<" "<<d<<endl;
            break;
        }
        all = all+1;
        if((a*a)+(b*b)==(c*c)||(b*b)+(c*c)==(a*a)||(a*a)+(c*c)==(b*b)){
            t=t+1;
            
        }else if((a*a)+(b*b)<c*c||(b*b)+(c*c)<a*a||(a*a)+(c*c)<b*b){
            d=d+1;
            
        }else if((a*a)+(b*b)>c*c||(b*b)+(c*c)>a*a||(a*a)+(c*c)>b*b){
            e=e+1;
            
        }
    }
//    cout<<all<<" "<<t<<" "<<e<<" "<<d<<endl;
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#include <ostream>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

std::ostream& operator << (std::ostream& os, const std::vector<int>& v) {
  for (int i = 0; i < v.size(); ++i) {
    os << v[i] << " \n"[i == v.size() - 1];
  }
  return os;
}

int main() {
  std::vector<int> tri(4, 0), edge(3);

  while (cin >> edge[0] >> edge[1] >> edge[2]) {
    std::sort(edge.begin(), edge.end(), std::greater<int>());

    int largest = edge[0] * edge[0], others = edge[1] * edge[1] + edge[2] * edge[2];

    if (edge[0] >= edge[1] + edge[2]) {
      break;
    }
    else if (largest == others) {
      tri[1]++;
    }
    else if (largest < others) {
      tri[2]++;
    }
    else if (largest > others) {
      tri[3]++;
    }

    tri[0]++;
  }

  cout << tri << endl;

  return 0;
}

C++: #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;a++) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	vector <int>a(3);
	int choku = 0, ei = 0, don = 0;
	while (cin >> a[0] >> a[1] >> a[2]) {
		Sort(a);
		if (a[0] + a[1] <= a[2])
		{
		break;
		}
		int a2[3];
		rep(i, 3) {
			a2[i] = a[i] * a[i];
		}
		if (a2[0] + a2[1] == a2[2]) 
		{ 
			choku++;
		}
		else if (a2[0] + a2[1] > a2[2]) 
		{ 
			ei++;
	//cout << "shine" << endl;
		}
		else 
		{
			don++;
		}
	}
	cout << choku + ei + don << " " << choku << " " << ei << " " << don << endl;
	return 0;
}

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

C++: #include <iostream>

using namespace std;

int main()
{
	int a[100], b[100], c[100],d,e,f,n;
	n = 0;
	d = 0;
	e = 0;
	f = 0;
	while (n <= 100)
	{
	A:
		cin >> a[n] >> b[n] >> c[n];
		if (a[n] + b[n] <= c[n] || a[n] + c[n] <= b[n] || b[n] + c[n] <= a[n])
		{
			break;
		}
		else
		{
			if (a[n] * a[n] + b[n] * b[n] == c[n] * c[n] || a[n] * a[n] + c[n] * c[n] == b[n] * b[n] || b[n] * b[n] + c[n] * c[n] == a[n] * a[n])
			{
				d++;
				n++;
				goto A;
			}
		    if (a[n] * a[n] + b[n] * b[n] > c[n] * c[n] || a[n] * a[n] + c[n] * c[n] > b[n] * b[n] || b[n] * b[n] + c[n] * c[n] > a[n] * a[n])
			{
				e++;
				f = f - 1;
				n++;
				goto A;
			}
			if (a[n] * a[n] + b[n] * b[n] < c[n] * c[n] || a[n] * a[n] + c[n] * c[n] < b[n] * b[n] || b[n] * b[n] + c[n] * c[n] < a[n] * a[n]) 
			{
				f++;
				n++;
				goto A;
			}
		}
	}
	cout << n<<" "<<d<<" "<<e<<" "<<f<<endl;
	return 0;
}

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

int a, b, c, s, x, y;
int d = 0, e = 0, t = 0;

int main() {

	while (1) {
		cin >> a >> b >> c; //各辺の入力

		if (a + b <= c)		//aとbを固定して三角形の条件式
			break;

		x = a ^ 2 + b ^ 2;	//aとbを固定して計算
		y = c ^ 2;			//cを固定して計算

		if (x < y)
			e++;
		if (x == y)
			t++;
		if (x > y)
			d++;
	}

	s = d + e + t;
	cout << s << " " << t << " " << e << " " << d << endl;

	return 0;

}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)),(x).end())

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef std::priority_queue<int> IntPrioQueue; //Z->A
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue; //A->Z

const int MAX = 200000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const int MOD = 1000000007;

int ls[3], cnt, don, cho, ei;

void solve(void){
    while (1) {
        scanf("%d %d %d\n", &ls[0], &ls[1], &ls[2]);
        sort(ls, ls+3);
        if (ls[0] + ls[1] <= ls[2]) {
            printf("%d %d %d %d\n", cnt, cho, ei, don);
            break;
        }
        cnt++;
        if (ls[0]*ls[0] + ls[1]*ls[1] == ls[2]*ls[2]) cho++;
        else if (ls[0]*ls[0] + ls[1]*ls[1] > ls[2]*ls[2]) ei++;
        else don++;
    }
}

int main(void){
  solve();
  return 0;
}