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 <cstdio>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stack>
#include <climits>
#include <deque>
#include <bitset>
#include <cassert>
#include <ctime>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
const int dy[]={-1,0,1,0},dx[]={0,1,0,-1};
// adjust problem by problem
const double EPS=1e-8;
const double PI=acos(-1.0);
#ifdef __GNUC__
int popcount(int n){return __builtin_popcount(n);}
int popcount(ll n){return __builtin_popcountll(n);}
#endif
#ifndef __GNUC__
template<class T> int popcount(T n){int cnt=0;while(n){if(n%2)cnt++;n/=2;}return cnt;}
#endif
template<class T>int SIZE(T a){return a.size();}
template<class T>string IntToString(T num){string res;stringstream ss;ss<<num;return ss.str();}
template<class T>T StringToInt(string str){T res=0;for(int i=0;i<SIZE(str);i++)res=(res*10+str[i]-'0');return res;}
template<class T>T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template<class T>T lcm(T a,T b){return a/gcd(a,b)*b;}
template<class T> void PrintSeq(T &a,int sz){for(int i=0;i<sz;i++){cout<<a[i];if(sz==i+1)cout<<endl;else cout<<' ';}}
bool EQ(double a,double b){return abs(a-b)<EPS;}
void fastStream(){cin.tie(0);std::ios_base::sync_with_stdio(0);}
vector<string> split(string str,char del){
  vector<string> res;
  for(int i=0,s=0;i<SIZE(str);i++){
    if(str[i]==del){if(i-s!=0)res.push_back(str.substr(s,i-s));s=i+1;}
    else if(i==SIZE(str)-1){res.push_back(str.substr(s));}
  }
  return res;
}

int main(){

  int x,y,z;
  int tri=0;
  int t=0;
  int e=0;
  int d=0;
  while(cin>>x>>y>>z){
    vector<int> v;
    v.push_back(x);
    v.push_back(y);
    v.push_back(z);
    sort(v.begin(),v.end());
    if(v[0]+v[1]<=v[2])break;
    else{
      tri++;
      if(v[0]*v[0]+v[1]*v[1]==v[2]*v[2])t++;
      else if(v[0]*v[0]+v[1]*v[1]>v[2]*v[2])e++;
      else d++;
    }
  }
  cout<<tri<<" "<<t<<" "<<e<<" "<<d<<endl;
  
  return 0;
}

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

#define llong long long
#define inf 999999999
#define mp make_pair
#define pb push_back
#define fn fill_n
typedef pair<int, int> P;
typedef pair<P, int> PP;
typedef pair<PP, int> PPP;
typedef struct data{
	int now;
	int cost;
}data;
int nh[4] = {1, 0, -1, 0};
int nw[4] = {0, 1, 0, -1};





int main(){
	int num[3];
	int many[4];
	fn(many, 4, 0);
	while(scanf("%d%d%d", &num[0], &num[1], &num[2]) != EOF){
		if(num[0] + num[1] > num[2] && num[1] + num[2] > num[0] && num[2] + num[0] > num[1]){
			many[0]++;
			sort(num, num + 3);
			int check = num[0] * num[0] + num[1] * num[1] - num[2] * num[2];
			if(check > 0) many[2]++;
			else if(check == 0) many[1]++;
			else if(check < 0) many[3]++;
		}else break;
	}
	for(int i = 0; i < 4; i++){
		cout << many[i];
		if(i != 3) cout << " ";
		else cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a[3];
	int t = 0, x = 0, y = 0, z = 0;
	bool b = true;
	while (cin >> a[0] >> a[1] >> a[2]){
		if (!b)continue;
		sort(a, a + 3);
		if (a[0] + a[1] <= a[2]){
			b = false;
			continue;
		}else{
			t++;
			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 if (a[0] * a[0] + a[1] * a[1] >= a[2] * a[2])z++;
		}
	}
	cout << t << ' ' << x << ' ' << y << ' ' << z << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,count1=0,count2=0,count3=0,count4=0;
  while(cin>>a>>b>>c ){
      int ia,ib,ic,max,z;
      ia=a*a;
      ib=b*b;
      ic=c*c;
      if(ia>=ib && ia>=ic) {
	if(a<b+c) {
	  max=ia;
	  ia=ic;
	}
	else break;
      }
      
      else if(ib>=ia && ib>=ic) {
	if(b<a+c) {
	  max=ib;
	  ib=ic;
	}
	else break;
      }
      else if(ic>=ia && ic>=ib) {
	if(c<a+b) {
	  max=ic;
	}
	else break;
      }
      else break;
      count1++;
      if(max==ia+ib) count2++;
      else if(max<ia+ib) count3++;
      else count4++;
  }
  cout<<count1<<" "<<count2<<" "<<count3<<" "<<count4<<endl;
  return 0;
  
}

C++: #include<iostream>
#include<algorithm>

using namespace std;

int main() {
	
	int Length[3];
	int Triangle[4] = {0};
	bool flag = 0;
	
	while( cin >> Length[0] >> Length[1] >> Length[2]) {
	
	sort(Length, Length+3);
	
	if( Length[0] + Length[1] <= Length[2] ) flag = 1;
	if(flag == 1) continue;
	
	if( Length[0] * Length[0] + Length[1] * Length[1] 
	== Length[3] * Length[3] )
	Triangle[1]++;
	
	else if(Length[0] * Length[0] + Length[1] * Length[1] 
	< Length[3] * Length[3] )
	Triangle[2]++;
	
	else
	Triangle[3]++;
	
	Triangle[0]++;
	}

	cout << Triangle[0] << " " << Triangle[1] << " "
		 << Triangle[2] << " " << Triangle[3] << "\n";
	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) )
		{
			cout << tris << " " << right_tris << " " << acute_tris << " " << obtuse_tris << endl;
			return 0;
		}

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

	return 0;
}

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 <stdio.h>
#include <algorithm>
using namespace std;

int main(){
    int inp[3], tyoku = 0, don = 0, ei = 0;
    for (int i = 0; i < 5; i++){
        scanf("%d %d %d",&inp[0], &inp[1], &inp[2]);
        sort(inp, inp + 3);
        
        if(inp[0] + inp[1] > inp[2]){
            int p = inp[0]*inp[0] + inp[1]*inp[1];
            int q = inp[2]*inp[2];
            if(p == q) tyoku++;
            else if(p < q) ei++;
            else don++;
        }
    }
    
    printf("%d %d %d %d¥n", tyoku +don +ei, tyoku,ei,don);
    return 0;
}