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<cmath>
#include<algorithm>
using namespace std;
int a[3], p, q, r;
int main() {
	while (true) {
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		if (a[0] + a[1] <= a[2]) { cout << p + q + r << ' ' << p << ' ' << q << ' ' << r << ' ' << endl; }
		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) { p++; }
		if (a[0] * a[0] + a[1] * a[1] > a[2] * a[2]) { q++; }
		if (a[0] * a[0] + a[1] * a[1] < a[2] * a[2]) { r++; }
	}
}

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

int main(){
	int a[3], x=0, y=0, z=0;
	while( scanf(" %d %d %d", &a[0], &a[1], &a[2]) != EOF ){
		sort(a, a+3);
		if(a[2]>=a[0]+a[1]) break;
	
		if(a[2]*a[2] == a[0]*a[0]+a[1]*a[1]) ++x;
		else if(a[2]*a[2] < a[0]*a[0]+a[1]*a[1]) ++y;
		else ++z;
	
	}
	
	printf("%d %d %d %d\n", x+y+z, x, y, z);

	return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	int a,b,c;
	int d[3];
	int A,B,C;
	A=B=C=0;
	while(cin>>a>>b>>c){
		d[0]=a;
		d[1]=b;
		d[2]=c;
		sort(d,d+3);
		if(d[0]+d[1]<=d[2]){
			cout <<A+B+C<<" "<<A<<" "<<B<<" "<<C<<endl;
			return 0;
		}
		int D =(d[0]*d[0]+d[1]*d[1]);
		int E =(d[2]*d[2]);
		if(D==E){
			A++;
		}else if(D >E){
			B++;
		}else if(D <E){
			C++;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
	int sideInfo[3];
	int total[4];

	memset(total, 0, sizeof(total));
	while (true) {
		cin >> sideInfo[0] >> sideInfo[1] >> sideInfo[2];
		sort(sideInfo, sideInfo + 3);
		if (sideInfo[0] + sideInfo[1] <= sideInfo[2]) {
			break;
		}
		++total[0];
		for (int i = 0; i < 3; ++i) {
			sideInfo[i] *= sideInfo[i];
		}
		if (sideInfo[0] + sideInfo[1] == sideInfo[2]) {
			++total[1];
		}else if (sideInfo[0] + sideInfo[1] > sideInfo[2]) {
			++total[2];
		}
		else {
			++total[3];
		}
	}
	cout << total[0];
	for (int i = 1; i < 4; ++i) {
		cout << " " << total[i];
	}
	cout << endl;

	return 0;
}

C++: #include <stdio.h>
int main(void){
   
  int a,b,c;
  int x;
  int d=0,e=0,t=0;
  
  while( 1 ){
  
    scanf("%d%d%d",&a,&b,&c);
     
    if( a > b ){
      x = a;
      a = b;
      b = x;
    }
    if( b > c ){
      x = b;
      b = c;
      c = x;
    }
    if( a > b ){
      x = a;
      a = b;
      b = x;
    }
     
    if ( c <= b - a || a + b <= c )break;
 
    if( c*c > a*a + b*b ){
      d++;
    }
    if( c*c < a*a + b*b ){
      e++;
    }
    if( c*c == a*a + b*b ){
      t++;
    }
     
  }
  printf("%d %d %d %d\n", d + e + t, t, e, d);
  return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
 
const int INF = 10000000;
const int mod = 1e9 + 7;
const double EPS = 1e-9;


int main(){
	vi v(3,0), ans(3, 0);
	double d;
	int n = 0;
	while(cin>>v[0]>>v[1]>>v[2]){
		sort(all(v));
		d = (double)(v[0]*v[0]+v[1]*v[1]-v[2]*v[2])/(2*v[0]*v[1]);
		if(v[2] >= v[1] + v[0]){
			cout<<n;
			for(int i = 0; i < 3; i++){
				cout<<" "<<ans[i];
			}
			cout<<endl;
			break;
		}
		if(d > 0) ans[1]++;
		else if (d < 0) ans[2]++;
		else ans[0]++;
		n++;
	}
}

C++: #include<stdio.h>
#include<algorithm>
int p[3];
using namespace std;
int main(){
    int a=0,b=0,c=0,d=0;
    while(~scanf("%d%d%d",p,p+1,p+2)){
        std::sort(p,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 <iostream>
using namespace std;

int main()
{
    int a = 0, b = 0, c = 0;

    while (1) {
        int x, y, z;
        cin >> x >> y >> z;

        if (x < y) swap(x, y);
        if (y < z) swap(y, z);
        if (x < y) swap(x, y);

        if (x >= y + z) break;

        int tmp = x*x - y*y - z*z;
        if (tmp == 0) ++a;
        else if (tmp < 0) ++b;
        else ++c;
    }

    cout << a+b+c << " " << a << " " << b << " " << c << endl;

    return 0;
}

C++: #include <bits/stdc++.h>
#define sqr(x) ((x) * (x))
using namespace std;
int a[3], p, q, r;
int main() {
	ios::sync_with_stdio(false);
	while(cin >> a[0] >> a[1] >> a[2]) {
		sort(a, a + 3);
		if(a[0] + a[1] >= a[2]) break;
		if(sqr(a[0]) + sqr(a[1]) == sqr(a[2])) p++;
		else if(sqr(a[0]) + sqr(a[1]) < sqr(a[2])) q++;
		else r++;
	}
	cout << p + q + r << ' ' << p << ' ' << q << ' ' << r << 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)
	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<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])
				z++;
			else y++;
		}
	}
	cout << x + y + z << ' ' << x << ' ' << y << ' ' << z << endl;
}