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

#define Avec vec[0] >> vec[1] >> vec[2]
#define Lrule pow(vec[0], 2) + pow(vec[1], 2)
#define Rrule pow(vec[2], 2)

int main() {
	int tri = 0; int rig = 0;
	int acu = 0; int obt = 0;
	vector<int> vec(3);
	while (cin >> Avec) {
		sort(vec.begin(), vec.end());
		if (vec[0] + vec[1] > vec[2]) {
			tri++;
			if (Lrule == Rrule) rig++;
			else if (Lrule > Rrule) acu++;
			else if (Lrule < Rrule) obt++;
		}
		else break;
	}
	cout << tri << " " << rig << " " << acu << " " << obt << endl;
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
 
using namespace std;
 
int main()
{
	int tris = 0;
	int right_tris = 0;
	int acute_tris = 0;
	int obtuse_tris = 0;
	for( int i = 0; i < 100; i ++)
	{
		int a, b, c;
		if( !(cin >> a) )
		{
			break;
		}

		cin >> b >> c;


		if( (a + b > c) && (b + c > a) && (c + a > b) )
		{
			tris ++;

			bool is_acute = false;
			int d = b * b + c * c;
			int aa = a * a;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				is_acute = true;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
			d = c * c + a * a;
			aa = b * b;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				is_acute = true;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
			d = a * a + b * b;
			aa = c * c;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				is_acute = true;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
			if( is_acute )
			{
				acute_tris++;
			}
		}
		else
		{
			break;
		}
	}

	cout << tris << " " << right_tris << " " << acute_tris << " " << obtuse_tris << endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define r(i,n) for(i=0;i<n;i++)
using namespace std;
int main(){
  int a[3],b[3]={0},s=0;
  while(cin>>a[0]>>a[1]>>a[2]){
    sort(a,a+3);
    if(a[0]+a[1]<=a[2])break;
    s++;
    if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1])b[0]++;
    if(a[2]*a[2]<a[0]*a[0]+a[1]*a[1])b[1]++;
    if(a[2]*a[2]>a[0]*a[0]+a[1]*a[1])b[2]++;
  }
  cout<<s<<' '<<b[0]<<' '<<b[1]<<' '<<b[2]<<endl;
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  vary(ll,v,3,0);
  ll a = 0,b = 0,c = 0,d = 0;
  while(1){
    cin >> v[0] >> v[1] >> v[2];
    sort(all(v));
    if(! (v[2] < v[0] + v[1])){
      cout << a << " " << b << " " << c << " " << d << endl;
      break;
    }
    else if(v[0] * v[0] + v[1] * v[1] == v[2] * v[2]) ++b;
    else if(v[0]*v[0] + v[1]*v[1] > v[2] * v[2]) ++ c;
    else if(v[0]*v[0] + v[1]*v[1] < v[2] * v[2]) ++ d;
    ++a;
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int num,s,t;
int main(){

    int x[3];
    while(cin>>x[0]>>x[1]>>x[2]){
        sort(x,x+3);
        int a = x[0],b = x[1],c = x[2];
        if(a+b<=c)break;
        if(a*a+b*b==c*c)s++;
        else if(a*a+b*b>c*c)t++;
        num++;
    }
    cout<<num<<" "<<s<<" "<<t<<" "<<num-s-t<<endl;

    return 0;
}

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

C++: #include <stdio.h>
#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[0]+a[1]<=a[2])break;
        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++;
    }
    printf("%d %d %d %d\n",x+y+z,x,z,y);
}