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 <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
 
using namespace std;
 
#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
 
template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }
 
typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
 
int main(){
  int a, b, c;
  int ans[4] = {};
  while(cin>>a>>b>>c){
    if(!(c > b - a)) break;
    if(!(c > a - b)) break;
    if(!(c < a + b)) break;
    if(a > b) swap(a, b);
    if(b > c) swap(b, c);
    int D = a * a + b * b  - c * c;
    ans[0]++;
    if(D > 0) ans[1]++;
    if(D == 0) ans[2]++;
    if(D < 0) ans[3]++;
  }
  printf("%d %d %d %d\n", ans[0], ans[2], ans[1], ans[3]);
  return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int a,b,c,s=0,s1=0,s2=0,s3=0,q;
	while(cin>>a>>b>>c)
	{
		if(a<b)
		{
			q=a;a=b;b=q;
		}
		if(a<c)
		{
			q=a;a=c;c=q;
		}
		if(a>=b+c)break;
		else
		{
			s++;
			if((a*a)==(b*b)+(c*c))s1++;
			else if((a*a)<(b*b)+(c*c))s2++;
			else if((a*a)>(b*b)+(c*c))s3++;
		}
	}
	cout<<s<<" "<<s1<<" "<<s2<<" "<<s3<<" ";
}

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

using namespace std;

int main()
{
    int acute = 0;
    int obtuse = 0;
    int right = 0;

    while (true) {
        int a, b, c;
        cin >> a >> b >> c;

        auto checkTriangle = [](int a, int b, int c) { return a < (b + c); };
        auto radToDegree = [](double rad) { return rad * 180 / M_PI; };
        auto angle = [radToDegree](int a, int b, int c) {
            auto x = static_cast<double>(b * b + c * c - a * a) / (2 * b * c);
            return radToDegree(acos(x));
        };
        auto isObtuse = [](double theta) {
            return 90.0 < theta && theta < 180.0;
        };

        if (checkTriangle(a, b, c) && checkTriangle(b, a, b) &&
            checkTriangle(c, a, b)) {
            auto theta1 = angle(a, b, c);
            auto theta2 = angle(b, a, c);
            auto theta3 = angle(c, a, b);
            if (theta1 == 90.0 || theta2 == 90.0 || theta3 == 90.0) {
                right += 1;
            }
            else if (isObtuse(theta1) || isObtuse(theta2) || isObtuse(theta3)) {
                obtuse += 1;
            }
            else {
                acute += 1;
            }
        }
        else {
            cout << (acute + obtuse + right) << " " << right << " " << acute
                 << " " << obtuse << endl;
            break;
        }
    }
}

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

using namespace std;

int sankaku,eikaku,tyokkaku,donkaku;
int hen[3];

int main(void){

  sankaku = eikaku = tyokkaku = donkaku = 0;

  while( cin >> hen[0] >> hen[1] >> hen[2] ){

    sort( hen , hen + 3 );
    
    if( hen[2] >= hen[0] +  hen[1] ) continue;
    sankaku++;
    
    for( int i = 0 ; i < 3 ; i++ )
      hen[i] = pow( (double)hen[i] , 2 );
    
    if( hen[2] == hen[0] + hen[1] ) tyokkaku++;
    if( hen[2] < hen[0] + hen[1] ) eikaku++;
    if( hen[2] > hen[0] + hen[1] ) donkaku++;
    
  }
  cout << sankaku << " " << tyokkaku << " " << eikaku << " " << donkaku << endl;
  return 0;
}

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

using namespace std;

int main(){
  int all=0, a=0, b=0, c=0;
  vector<int> data(3);
  bool end = false;

  while(cin >> data[0] >> data[1] >> data[2]){
    if(end) continue;
    sort(data.begin(), data.end());

    if(data[0]+data[1] <= data[2]){
      cout << all << " " << a << " " << b << " " << c << endl;
      end = true;
      continue;
    }

    if(data[0]*data[0] + data[1]*data[1] == data[2]*data[2]) ++a;
    else if(data[0]*data[0] + data[1]*data[1] > data[2]*data[2]) ++b;
    else ++c;

    ++all;
  }
  return 0;
}

C++: #include<cstdio>

int main(void){
    
    int a=0,b=0,c=0;
    int change=0,judge=0,exi=0;
    int right=0,acute=0,obtuse=0,count=0;
    while(true){
        scanf("%d %d %d",&a,&b,&c);
        
        if(c<a){
            change=a;
            a=c;
            c=change;
        }
        if(c<b){
            change=b;
            b=c;
            c=change;
        }
        judge=a*a+b*b-c*c;
        exi=a+b-c;
        if(exi<0){
            break;
        }
        if(judge>0){
            acute++;
        }
        else if(judge==0){
            right++;
        }
        else{
            obtuse++;
        }
        count++;
    }
    
    printf("%d %d %d %d\n",count,right,acute,obtuse);
    return 0;
}

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

C++: #include<iostream>
using namespace std;
int main(){
    int d=0,e=0,f=0,g=0;
    for(;;){
       int a,b,c;
       cin>>a>>b>>c;
       if(a+b>c&&a+c>b&&b+c>a){
         if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a){
           e++;
         }
         else if(a*a+b*b<c*c||a*a+c*c<b*b||b*b+c*c<a*a){
                f++;
         }
         else{
             g++;
         }
         d++;
       }
       else{break;}
    }
    cout<<d<<" "<<e<<" "<<g<<" "<<f<<endl;
    return 0;
}

C++: 
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
using namespace std;
typedef long long unsigned int ll;

#define rep(i,n)for(i=0;i<n;i++)

#define INF (1e9)
#define PI  (acos(-1))




int main()
{
	int lines[3];
	int a = 0, b=0 , c=0, d=0;
	while(true){
		cin >> lines[0] >> lines[1] >> lines[2];
		sort(lines, lines + 3);

		int left = lines[0] * lines[0] + lines[1] *lines[1];
		if (lines[2] >= lines[0]+lines[1] ) {
			//三角形不成立
			cout << a << " " << b << " " << c << " " << d << endl;
			return(0);
		}else if (left == lines[2] *lines[2]) {
			//直角三角形
			a++;
			b++;
		}
		else if (left> lines[2] * lines[2]) {
			//鋭角三角形
			a++;
			c++;
		}
		else if (left < lines[2] * lines[2]) {
			//鈍角三角形
			a++;
			d++;
		}
	}

	return 0;


}