Go: package main
// 三角形の形は辺の長さで決まる． 順番に３つの正整数が与えられたとき， 辺の長さがそれらの値と一致する三角形が存在するかどうかを調べ,
//  存在するなら鋭角三角形，直角三角形，鈍角三角形のいずれかを判定し， 次の入力へ進む． 三角形が存在しないとき， それまでに入力された，
// 三角形，直角三角形，鋭角三角形，鈍角三角形の 個数を空白で区切って出力し， それ以降の入力は無視して終了する
// 入力の中には必ず三角形が存在しないようなものがある と仮定してよい. 入力の行数は判らないが各行には３つの正整数が空白で区切って書かれている．
//  ただし，各整数は100 以下とする.

// return
// 三角形 直角三角形　鈍角三角形 鈍角三角形
import (
	"os"
	"fmt"
	"bufio"
)


var sc = bufio.NewScanner(os.Stdin)

func max(a, b, c int) (int, int, int) {
	if a > b {
		if b > c {
			return a, b, c
		} else {
			return a, c, b
		}
	} else {
		if b > c {
			return b, a, c
		} else {
			return c, b, a
		}
	}
}

func find_trianges(a, b, c int) string {
	a, b, c = max(a, b, c)
	r := b*b + c*c
	if a*a > r {
		return "obtuse_triangle"
	} else if a*a < r {
		return "sharped_triangle"
	} else {
		return "right_triangle"
	}
}

func main() {
	s := bufio.NewScanner(os.Stdin)
	var t, r_t, s_t, o_t int = 0, 0, 0, 0
	for s.Scan() {
		var a, b, c int
		fmt.Sscan(s.Text(), &a, &b, &c)
			a, b, c = max(a, b, c)
			if (a < b + c) {
				r := find_trianges(a, b, c)
				switch r {
				case "right_triangle":
					r_t++
				case "sharped_triangle":
					s_t++
				case "obtuse_triangle":
					o_t++
				}
				t++
			}	else {
				break
			}
			
	}
	fmt.Println(t, r_t, s_t, o_t)
}

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[2] * Length[2] )
	Triangle[1]++;
	
	else if(Length[0] * Length[0] + Length[1] * Length[1] 
	< Length[2] * Length[2] )
	Triangle[2]++;
	
	else
	Triangle[3]++;
	
	Triangle[0]++;
	}

	cout << Triangle[0] << " " << Triangle[1] << " "
		 << Triangle[2] << " " << Triangle[3] << "\n";
	return 0;
}

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

using namespace std;

namespace prob0582 {
	enum TriangleType { DoesNotExist = 0, RightAngle, Accute, Obtuse };

	TriangleType checkTriangleType(array<int, 3> edges)
	{
		int longest = 0;
		int longest2sq = 0;
		int sum = 0;
		int sumsq = 0;

		for (int i = 0; i < 3; ++i) {
			if (edges[i] > longest) longest = edges[i];
			sum += edges[i];
			sumsq += edges[i] * edges[i];
		}
		longest2sq = 2 * longest * longest;

		if (sum <= 2 * longest) return DoesNotExist;
		if (sumsq > longest2sq) return Accute;
		if (sumsq == longest2sq) return RightAngle;
		return Obtuse;
	}

	void solve(istream &sin, ostream &sout)
	{
		int total = 0;
		int eachType[]{ 0,0,0,0 };

		array<int, 3> edges;
		TriangleType type;

		do
		{
			sin >> edges[0] >> edges[1] >> edges[2];
			++total;
			type = checkTriangleType(edges);
			eachType[static_cast<int>(type)]++;
		} while (type != DoesNotExist);
		--total;

		sout << total;
		for (int i = 0; i < 3; ++i) sout << " " << eachType[i + 1];
		sout << endl;
	}
}

int main()
{
	prob0582::solve(cin, cout);
}

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

int main(){
  int a[3];

  int t,l,v,g;
  t = l = v = g = 0;
  while(cin >> a[0] >> a[1] >> a[2]){
    sort(a,a+3);
    if(a[0]+a[1]<=a[2])cout << t << " " << v << " " << l << " " << g << endl;
    else{
      t++;
      int s = a[0]*a[0]+a[1]*a[1]-a[2]*a[2];
      if(s<0)g++;
      else if(s==0)v++;
      else l++;
    }
  }
}

C++: #include<cstdio>

int partition(int A[], int p, int r){
    int x = A[r];
    int i = p-1;
    for(int j=p; j<r; j++){
        if(A[j]<= x){
            i++;
            int temp = A[i];
            A[i] = A[j];
            A[j] = temp;
        }
    }
    int temp = A[r];
    A[r] = A[i+1];
    A[i+1] = temp;
    return i+1;
}

void quickSort(int A[], int p, int r){
    if(p<r){
        int q = partition(A, p, r);
        quickSort(A, p, q-1);
        quickSort(A, q+1, r);
    }
}

int main(){
    int l[3];
    int cnt[4] ={0};

    while(1){
        for(int i=0; i<3; i++) scanf("%d", &l[i]);
        quickSort(l, 0, 2);
        double a = (double)l[0], b=(double)l[1], c=(double)l[2];

        if(!(a+b>c && b+c>a && c+a>b)) break;
        
        cnt[0]++;
        double cosine = (b*b+a*a-c*c)/(2*b*c);
        if(cosine == 0) cnt[1]++;
        else if(cosine >0) cnt[2]++;
        else cnt[3]++;
    }

    for(int i=0; i<4; i++){
        if(i) printf(" ");
        printf("%d", cnt[i]);
    }
    printf("\n");

    return 0;
}

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)) continue;
    if(!(c > a - b)) continue;
    if(!(c < a + b)) continue;
    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<algorithm>
#include<map>
using namespace std;
int main() {
	int s=0, t=0, e=0, d=0;
	while (true) {
		int a[3];
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		if (a[0] + a[1] <= a[2]) break;
		long long b = a[0] * a[0] + a[1] * a[1];
		long long c = a[2] * a[2];
		s++;
		if (b == c) t++;
		else if (b < c) d++;
		else e++;
	}
	cout << s << " " << t << " " << e << " " << d << endl;
}

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;
		cin >> a >> b >> c;

		if( a == 0 )
		{
			cout << tris << " " << right_tris << " " << acute_tris << " " << obtuse_tris << endl;
			return 0;
		}

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

			int d = b * b + c * c;
			int aa = a * a;

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

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

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

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  int p[3]={},a=0,b=0,c=0,d=0;
  while(cin >> p[0] >> p[1] >> p[2]) {
      sort(p,p+3);
      if(p[0]+p[1]<=p[2]) {
          cout << a << " " << b << " " << c << " " << d << endl;
          return 0;
      }
      a++;
      if(p[0]*p[0]+p[1]*p[1]==p[2]*p[2]) {
          b++;
      }
      else if(p[0]*p[0]+p[1]*p[1]>p[2]*p[2]) {
          c++;
      }
      else if(p[0]*p[0]+p[1]*p[1]<p[2]*p[2]) {
          d++;
      }
  }
}