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>
using namespace std;

int main() {
    int INF = 100000;
    int a[INF], b[INF], c[INF];
    for (int i = 0; i < INF; ++i) {
        cin >> a[i] >> b[i] >> c[i];
        if (a[i] > b[i]) {
            int t = a[i];
            a[i] = b[i];
            b[i] = t;
        }
        if (b[i] > c[i]) {
            int t = b[i];
            b[i] = c[i];
            c[i] = t;
        }
        if (a[i] > b[i]) {
            int t = a[i];
            a[i] = b[i];
            b[i] = t;
        }
    }

    int tr = 0, ttr = 0, etr = 0, dtr = 0;
    for (int i = 0; i < INF; ++i) {
        if (c[i] >= a[i] + b[i]) {
            cout << tr << " " << ttr << " " << etr << " " << dtr << endl;
            break;
        }
        else if (c[i] * c[i] > a[i] * a[i] + b[i] * b[i]) {
            ++tr;
            ++dtr;
        }
        else if (c[i] * c[i] == a[i] * a[i] + b[i] * b[i]) {
            ++tr;
            ++ttr;
        }
        else if (c[i] * c[i] < a[i] * a[i] + b[i] * b[i]) {
            ++tr;
            ++etr;
        }
    }
    
    return 0;
}

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

bool check(vector<int>& vec)
{
  int a,b,c;
  a = vec[0],b = vec[1],c = vec[2];
  if(a >= b+c || b >= a+c || c >= a+b)
    return false;
  return true;
}

int main()
{
  int _1,_2,_3,_4;
  _1 = _2 = _3 = _4 = 0;
  while(true)
    {
      vector<int> vec;
      for(int i=0;i<3;i++)
	{
	  int a;
	  cin >> a;
	  vec.push_back(a);
	}
      sort(vec.begin(),vec.end());
      if(!check(vec))      
	break;
      int a,b,c;
      a = vec[0],b = vec[1],c = vec[2];

      _1++;
      if(c*c == a*a+b*b)
	_2++;
      if(c*c < a*a+b*b)
	_3++;
      if(c*c > a*a+b*b)
	_4++;

    }
  cout << _1 << " " << _2 << " " << _3 << " " << _4 << endl;
  return 0;
}

C++: #include<cstdio>
int main(void){
    
    int a=0,b=0,c=0;
    int change=0;
    int right=0,obtuse=0,acute=0;
    int value=0,check=0,count=0;
    int flag=true;
    while(flag){
        count++;
        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;
        }
        check=a+b-c;
        value=a*a+b*b-c*c;
        if(check<=0){
            break;
        }
        if(value==0){
            right++;
        }
        else if(value<0){
            obtuse++;
        }
        else{
            acute++;
        }
    }
    printf("%d %d %d %d\n",count,right,acute,obtuse);
    return 0;
}

C++: #include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"

#define MOD 1000000007 // 1e9+7
#define PI 3.1415926525
#define ll long long int // 10^18
#define INF 1000000001 // 1e9+1

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
//---------------------------
int a[3],b[4];

int main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  while(true){
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    if(a[2]>=a[0]+a[1])break;
    b[0]++;
    int rec=a[2]*a[2]-a[1]*a[1]-a[0]*a[0];
    if(rec==0)b[1]++;
    if(rec>0)b[3]++;
    if(rec<0)b[2]++;
  }
  REP(i,4){
    cout<<b[i]<<" \n"[i==3];
  }
  return 0;
}

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

using namespace std;

void solve()
{
	vector<int> edge(3);
	int triangle = 0;
	int right_triangle = 0;
	int acute_triangle = 0;
	int obtuse_triangle = 0;
	while(cin >> edge[0] >> edge[1] >> edge[2])
	{
		if(edge[0] + edge[1] > edge[2] && edge[1] + edge[2] > edge[0] && edge[2] + edge[0] > edge[1])
		{
			++triangle;
		}
		else
		{
			break;
		}
		sort(edge.begin(), edge.end());
		double cos_theta = (edge[0] * edge[0] + edge[1] * edge[1] - edge[2] * edge[2]) / (2 * edge[0] + edge[1]);
		if( edge[0] * edge[0] + edge[1] * edge[1] == edge[2] * edge[2] ||
			edge[1] * edge[1] + edge[2] * edge[2] == edge[0] * edge[0] ||
			edge[2] * edge[2] + edge[0] * edge[0] == edge[1] * edge[1])
		{
			++right_triangle;
		}
		else if(cos_theta < 0)
		{
			++obtuse_triangle;
		}
		else
		{
			++acute_triangle;
		}
	}
	cout << triangle << " " << right_triangle << " " << acute_triangle << " " << obtuse_triangle << endl;
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>

using namespace std;

int main() {
  int count_total = 0; // 合計
  int count_1 = 0; // 直角三角形
  int count_2 = 0; // 鋭角
  int count_3 = 0; // 鈍角
  while(true) {
    int long_side = 0;
    int short_side1 = 0;
    int short_side2 = 0;
    int a, b, c = 0;
    cin >> a >> b >> c;
    if (!(abs(b-c) < a && a < b + c)) {
      //cout << "-----" << endl;
      cout << count_total << " " << count_1 << " " << count_2 << " " << count_3 << endl;
      return 0;
    }
    count_total++;
    int max_side = a;
    if (b > a && b > c) {
      // bが一番長い
      long_side = b;
      short_side1 = a;
      short_side2 = c;
    } else if (c > a && c > b) {
      // cが一番長い
      long_side = c;
      short_side1 = a;
      short_side2 = b;
    } else {
      // aが一番長い
      long_side = a;
      short_side1 = b;
      short_side2 = c;
    }
    int d1 = long_side * long_side;
    int d2 = short_side1 * short_side1 + short_side2 * short_side2;
    // 鈍角
    if (d1 > d2) {
      count_3++;
    } else if (d1 == d2) {
      // 直角
      count_1++;
    } else {
      // 鋭角
      count_2++;
    }
  }

}