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 <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }



int a[3];

int main() {
    int t = 0, just = 0, ei = 0, don = 0;
    while (cin >> a[0] >> a[1] >> a[2]) {
        sort(a, a+3);
        if (a[2] >= a[0] + a[1]) break;
        
        ++t;
        if (a[2]*a[2] == a[0]*a[0] + a[1]*a[1]) ++just;
        else if (a[2]*a[2] > a[0]*a[0] + a[1]*a[1]) ++don;
        else ++ei;
    }
    
    cout << t << " " << just << " " << ei << " " << don << endl;
    return 0;
}

C++: #include <iostream>
#include <algorithm>
 
using namespace std;
 
int a[3];
int cnt[4];
 
bool calc(){
  for(int i=0;i<3;i++){
    if(a[i] + a[(i+1)%3] <= a[(i+2)%3]) return false;
  }
  cnt[0]++;
  if(a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) cnt[1]++;
  if(a[0] * a[0] + a[1] * a[1] > a[2] * a[2]) cnt[2]++;
  if(a[0] * a[0] + a[1] * a[1] < a[2] * a[2]) cnt[3]++;
  return true;
}
 
main(){
  fill(cnt, cnt+4, 0);
  bool f = true;
  while(cin >> a[0] >> a[1] >> a[2]){
    sort(a, a+3);
    if(f){
      if(!calc()) f = false;
    }
  }
  for(int i=0;i<4;i++){
    if(i) cout << ' ';
    cout << cnt[i];
  }
  cout << endl;
}

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