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;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

#define EPS 1e-8

int main(){
    int a=0,b=0,c=0,d=0;
    int x,y,z;
    while(cin>>x>>y>>z){
        vi in;
        in.pb(x);
        in.pb(y);
        in.pb(z);
        sort(all(in));
        
        if(in[0]+in[1]<=in[2]){
            cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
            while(cin>>x>>y>>z);
            break;
        }
        else a++;
        
        double l,m,n;
        l = acos( (-1*in[0]*in[0] + in[1]*in[1] + in[2]*in[2])/(2.0*in[1]*in[2]) );
        m = acos( (-1*in[1]*in[1] + in[2]*in[2] + in[0]*in[0])/(2.0*in[2]*in[0]) );
        n = acos( (-1*in[2]*in[2] + in[0]*in[0] + in[1]*in[1])/(2.0*in[0]*in[1]) );
        
        l=l*180/3.141592;
        m=m*180/3.141592;
        n=n*180/3.141592;

        
        if( (l-90)*(l-90)<EPS || (m-90)*(m-90)<EPS || (n-90)*(n-90)<EPS ){
            b++;
        }
        else if( l>90-EPS || m>90-EPS || n>90-EPS ){
            d++;
        }
        else c++;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int ttl=0,cho=0,eik=0,don=0;
    while(true){
        vi a(3);for(int i=0;i<3;i++)cin>>a[i];
        sort(a.begin(),a.end());
        if(a[0]+a[1]<=a[2]){
            printf("%d %d %d %d\n",ttl,cho,eik,don);
            return 0;
        }
        ttl++;
        if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])cho++;
        else if(a[0]*a[0]+a[1]*a[1]>a[2]*a[2])eik++;
        else don++;
    }
    return 0;
}

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

int main()
{	
	int a[3];
	int t[4] = { 0, 0, 0, 0 };

	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);

	while (a[0] + a[1] > a[2]) {
		t[0]++;

		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2])
			t[1]++;
		else if (a[0] * a[0] + a[1] * a[1] > a[2] * a[2])
			t[2]++;
		else
			t[3]++;

		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
	}

	cout << t[0] << " " << t[1] << " " << t[2] << " " << t[3] << endl;

	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[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>
using namespace std;

int main(){
  int hen[3];
  int cnt=0;
  int d=0;
  int e=0;
  
  while(1)
    {
      for(int i=0;i < 3;i++)
	{
	  cin >> hen[i];
	}
      sort(hen,hen+3);

      int judge = pow(hen[0],2) + pow(hen[1],2);
      int most = pow(hen[2],2);
      
      if(hen[0]+hen[1] > hen[2] && hen[1]+hen[2] > hen[0] && hen[2]+hen[0] > hen[1])
	{
	  if(judge < most)
	    {
	      d++;
	    }
	  else if(judge > most)
	    {
	      e++;
	    }
	  else if(judge == most)
	    {
	      cnt++;
	    }
	}
      else
	{
	  break;
	}
    }
  cout << cnt+d+e << " " << cnt << " " << d << " " << e << endl;
  return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a=0,b=0,c=0,d=0;
	int e[3];
	while(cin >> e[0] >> e[1] >> e[2]){
		sort(e,e+3);
		if(e[0]+e[1]>e[2]){
			++a;
			for(int i=0; i<3; ++i)	e[i]*=e[i];
			if(e[0]+e[1]==e[2])	++b;
			else if(e[0]+e[1]>e[2])	++c;
			else	++d;
		}else	break;
	}
	cout << a << " " << b << " " << c << " " << d << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>

#define LP(i,n) for(int i=0;i<n;i++)
#define Mset(x,v) memset(x,v,sizeof(x))
#define INF INT_MAX

using namespace std;
using LL=long long;

int main(){
    int H[3],s=0,t=0,e=0,d=0;
    while(1){
        cin>>H[0]>>H[1]>>H[2];
        sort(H,H+3);
        if(H[2]>=H[0]+H[1]) break;
        s++;
        if(H[0]*H[0]+H[1]*H[1]-H[2]*H[2]==0) t++;
        else if(H[0]*H[0]+H[1]*H[1]-H[2]*H[2]>0) e++;
        else if(H[0]*H[0]+H[1]*H[1]-H[2]*H[2]<0) d++;
    }
    cout<<s<<" "<<t<<" "<<e<<" "<<d<<endl;
    return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

#define EPS 1e-8

int main(){
    int a,b,c,d;
    int x,y,z;
    while(cin>>x>>y>>z){
        vi in;
        in.pb(x);
        in.pb(y);
        in.pb(z);
        sort(all(in));
        
        if(in[0]+in[1]<=in[2]){
            cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
            break;
        }
        else a++;
        
        double l,m,n;
        l = acos( (-1*in[0]*in[0] + in[1]*in[1] + in[2]*in[2])/(2.0*in[1]*in[2]) );
        m = acos( (-1*in[1]*in[1] + in[2]*in[2] + in[0]*in[0])/(2.0*in[2]*in[0]) );
        n = acos( (-1*in[2]*in[2] + in[0]*in[0] + in[1]*in[1])/(2.0*in[0]*in[1]) );
        
        l=l*180/3.141592;
        m=m*180/3.141592;
        n=n*180/3.141592;

        
        if( (l-90)*(l-90)<EPS || (m-90)*(m-90)<EPS || (n-90)*(n-90)<EPS ){
            b++;
        }
        else if( l>90-EPS || m>90-EPS || n>90-EPS ){
            d++;
        }
        else c++;
    }
}

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

int san = 0;
int a[3];
int inu = 0;
int saru = 0;
int kiji = 0;

int main(){
	while (true){
		for (int i = 0; i < 3; i++){
			cin >> a[i];
		}
		sort(a, a + 3);
		if (a[2] * a[2] < a[1] * a[1] + a[0] * a[0] && a[2] < a[0] + a[1]){
			san = san + 1;
			saru = saru + 1;
		}if (a[2] * a[2] == a[1] * a[1] + a[0] * a[0] && a[2] < a[0] + a[1]){
			san = san + 1;
			inu = inu + 1;
		}if (a[2] * a[2] > a[1] * a[1] + a[0] * a[0] && a[2] < a[0] + a[1]){
			san = san + 1;
			kiji = kiji + 1;
		}if (a[2] >= a[0] + a[1]){
			break;
		}
	}
	cout << san << " " << inu << " " << saru << " " << kiji << endl;
}