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 long long ll;

int main() {
  vector<int> cnt(3,0);
  while(true) {
    vector<int> v(3);
    cin >> v[0] >> v[1] >> v[2];
    sort(v.begin(),v.end());
    if(v[2] >= v[0]+v[1])
       break;
    if(v[2]*v[2] > v[0]*v[0] + v[1]*v[1])
      cnt[2]++;
    if(v[2]*v[2] == v[0]*v[0] + v[1]*v[1])
      cnt[1]++;
    else
      cnt[0]++;
  }
  cout << cnt[0] + cnt[1] + cnt[2] << cnt[1] << " " << cnt[0] << " " << cnt[2] << endl;
}

C++: #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <iterator>
#include <stack>
using namespace std;

/*
const int MAX=1000;
vector<vector<int> > memo(MAX,vector<int>(MAX));
vector<vector<int> > done(MAX,vector<int>(MAX));
int dfs(vector<vector<int> > vi,int i,int j,int sum);

int main(){
	//ios::sync_with_stdio(false);
	//cin.tie(0);
	int m,n;
	while(cin>>m>>n&&m!=0&&n!=0){
		vector<vector<int> > ice(m,vector<int>(n));
		int ans=0;
		for(int i=0; i<MAX; ++i){
			for(int j=0; j<MAX; ++j){
				memo[i][j]=0;
				done[i][j]=0;
			}
		}
		for(int i=0; i<n; ++i){
			for(int j=0; j<m; ++j){
				cin >> ice[j][i];
			}
		}
		for(int i=0; i<n; ++i){
			for(int j=0; j<m; ++j){
				if(ice[i][j]==1) {
					ans=max(ans,dfs(ice,i,j,0));
				}
			}
		}
		cout << ans << "\n";
	}
	return 0;
}

int dfs(vector<vector<int> > vi,int i,int j,int sum){
	if(done[i][j]==1) return memo[i][j];
	if(i+1>=vi.size()&&j+1>=vi[i].size()&&i-1<0&&j-1<0&&vi[i+1][j]==0&&vi[i][j+1]==0&&vi[i-1][j]==0&&vi[i][j-1]==0) return sum;
	done[i][j]=1;
	++sum;
	if(i+1<vi.size()) memo[i][j]=dfs(vi,i+1,j,sum+1);
	if(j+1<vi[i].size()) memo[i][j]=dfs(vi,i,j+1,sum+1);
	if(i-1>=0) memo[i][j]=dfs(vi,i-1,j,sum+1);
	if(j-1>=0) memo[i][j]=dfs(vi,i,j-1,sum+1);
	return memo[i][j]; 
}
*/

int main(){
	vector<int> n(3);
	vector<int> cnt(4);
	while(cin>> n[0] >> n[1] >> n[2]){
		int MAX;
		if(n[0]>=n[1]&&n[0]>=n[2]) {
			MAX=n[0];
			if(MAX>=n[1]+n[2]) break;
			if(MAX*MAX==n[1]*n[1]+n[2]*n[2]) ++cnt[1];
			if(MAX*MAX<n[1]*n[1]+n[2]*n[2]) ++cnt[2];
			if(MAX*MAX>n[1]*n[1]+n[2]*n[2]) ++cnt[3];
		}
		else if(n[1]>=n[0]&&n[1]>=n[2]) {
			MAX=n[1];
			if(MAX>=n[0]+n[2]) break;
			if(MAX*MAX==n[0]*n[0]+n[2]*n[2]) ++cnt[1];
			if(MAX*MAX<n[0]*n[0]+n[2]*n[2]) ++cnt[2];
			if(MAX*MAX>n[0]*n[0]+n[2]*n[2]) ++cnt[3];
		}
		else if(n[2]>=n[0]&&n[2]>=n[1]) {
			MAX=n[2];
			if(MAX>=n[0]+n[1]) break;
			if(MAX*MAX==n[1]*n[1]+n[0]*n[0]) ++cnt[1];
			if(MAX*MAX<n[1]*n[1]+n[0]*n[0]) ++cnt[2];
			if(MAX*MAX>n[1]*n[1]+n[0]*n[0]) ++cnt[3];
		}
		++cnt[0];
	}
	for(int i=0; i<4; ++i){
		cout << cnt[i] << " ";
	}
	cout << "\n";
	return 0;
}

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

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]){
            while(cin>>x>>y>>z);
            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<stdio.h>
int main()
{
	int d=0,t=0,e=0,a,b,c,A,B,C,h;
	while(1){
		scanf("%d%d%d",&a,&b,&c);
		if(a>b&&a>c){
			C=a;
			A=b;
			B=c;
		}else if(b>a&&b>c){
			B=c;
			C=b;
			A=a;
		}else{
			A=a;
			B=b;
			C=c;
		}
		if(A+B<=C){
			printf("%d %d %d %d\n",d+t+e,t,e,d);
			break;
		}
		h=A*A+B*B-C*C;
		if(h>0){
			e++;
		}else if(h<0){
			d++;
		}else{
			t++;
		}
	}
	return 0;
}

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

int main(){
	int tri[3];
	int e[3];
	
	for(int i = 0; i < 3; i++) tri[i] = 0;
	while(true){
		scanf("%d %d %d", &e[0], &e[1], &e[2]);
		sort(e, e + 3);
		
		
		if(e[0] + e[1] > e[2]){
			if(e[0]*e[0] + e[1]*e[1] == e[2]*e[2]){
				tri[0]++;
			}
			else if(e[0]*e[0] + e[1]*e[1] > e[2]*e[2]){
				tri[1]++;
			}
			else if(e[0]*e[0] + e[1]*e[1] < e[2]*e[2]){
				tri[2]++;
			}
		}
		else break;
	}
	
	printf("%d %d %d %d\n", tri[0]+tri[1]+tri[2], tri[0], tri[1], tri[2]);
	
	return 0;
}

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

bool exist(int a,int b,int c){
    bool flag=false;
    if(a+b>c&&a+c>b&&c+b>a)flag=true;
    return flag;
}
int type_check(int a,int b,int c){
    if(a*a+b*b==c*c)return 1;
    else if(a*a<b*b+c*c)return 0;//鋭角
    else if(a*a>b*b+c*c)return 2;
    else return 3;
}

int main(){
    int a,b,c,c1=0,c2=0,c3=0,c4=0;
    while(true){
        cin >> a>>b>>c;

        if(!exist(a,b,c))break;
        switch(type_check(a,b,c)){
            case 0: c1++; break;
            case 1: c2++; break;
            case 2: c3++;break;
        }
        c4++;
    }
    cout <<c1<<" "<<c2<<" "<<c3<<" "<<c4 <<endl;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int a[4] = { 0 };
	while (true) {
		int l[3] = { 0 };
		cin >> l[0] >> l[1] >> l[2];
		sort(l, l + 3);
		int le = l[0] * l[0] + l[1] * l[1];
		int ri = l[2] * l[2];
		if (l[0] + l[1] <= l[2]) break;
		if (le == ri) a[1]++;
		if (le > ri) a[2]++;
		if (le < ri) a[3]++;
	}
	cout << a[1] + a[2] + a[3] << " " << a[1] << " " << a[2] << " " << a[3] << endl;
	return 0;
}

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

int main() {
  int a, b, c;
  int ansn = 0, ans1 = 0, ans2 = 0, ans3 = 0;
  while (cin >> a >> b >> c) {
    if (a + b > c && b + c > a && c + a > b) {
      ansn++;

      if (a < b) {
        int swap = a;
        a = b;
        b = swap;
      }
      if (a < c) {
        int swap = a;
        a = c;
        c = swap;
      }

      int A = b * b + c * c - a * a;

      if (A == 0) ans1++;
      else if (A > 0) ans2++;
      else ans3++;
    } else break;
  }

  cout << ansn << " " << ans1 << " " << ans2 << " " << ans3 << endl;

  return 0;
}