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 a > c {
			return b, a, c
		} else {
			return b, c, 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":
					r_t++
				}
				t++
			}	else {
				break
			}
			
	}
	fmt.Println(t, r_t, s_t, o_t)
}

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

using namespace std;

int main(int argc, char const *argv[]) {
    int edge[3];
    int tri[3]={0};//0:right, 1:acute, 2:obtuse
    int total=0;

    while(1){
        for(int i=0;i<3;i++)
            cin >> edge[i];
        sort(edge,edge+3);
        if(edge[2] < edge[0] + edge[1]){
            total++;
            if(pow(edge[2],2) == pow(edge[0],2) + pow(edge[1],2)){
                tri[0]++;
            }else if(pow(edge[2],2) < pow(edge[0],2) + pow(edge[1],2)){
                tri[1]++;
            }else{
                tri[2]++;
            }
        }else{
            break;
        }
    }
    printf("%d %d %d %d\n",total,tri[0],tri[1],tri[2]);
    return 0;
}

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

int main(){
	int tri[3];
	int e[3];
	
	for(int i = 0; i < 3; i++) tri[i] = 0;
	while((scanf("%d %d %d", &e[0], &e[1], &e[2])) != EOF){
		sort(e, e + 3);
		if(e[0] + e[1] > e[2]){
			if(e[0]*e[0] + e[1]*e[1] == e[2]*e[2]){
				tri[0]++;
			}
			else if(e[0]*e[0] + e[1]*e[1] > e[2]*e[2]){
				tri[1]++;
			}
			else if(e[0]*e[0] + e[1]*e[1] < e[2]*e[2]){
				tri[2]++;
			}
		}
	}
	
	printf("%d %d %d %d\n", tri[0]+tri[1]+tri[2], tri[0], tri[1], tri[2]);
	
	return 0;
}

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

int main(){
    int a;
    int b;
    int c;
    int t=0;
    int e=0;
    int d=0;
    int all=0;
    while(1){
        cin>>a>>b>>c;
        if(a+b<c||a+c<b||b+c<a){
            cout<<all<<" "<<t<<" "<<e<<" "<<d<<endl;
            break;
        }
        all = all+1;
        if((a*a)+(b*b)==(c*c)||(b*b)+(c*c)==(a*a)||(a*a)+(c*c)==(b*b)){
            t=t+1;
            
        }else if((a*a)+(b*b)<c*c||(b*b)+(c*c)<a*a||(a*a)+(c*c)<b*b){
            d=d+1;
            
        }else if((a*a)+(b*b)>c*c||(b*b)+(c*c)>a*a||(a*a)+(c*c)>b*b){
            e=e+1;
            
        }
    }
//    cout<<all<<" "<<t<<" "<<e<<" "<<d<<endl;
    return 0;
}

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

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

std::ostream& operator << (std::ostream& os, const std::vector<int>& v) {
  for (int i = 0; i < v.size(); ++i) {
    os << v[i] << " \n"[i == v.size() - 1];
  }
  return os;
}

int main() {
  std::vector<int> tri(4, 0), edge(3);

  while (cin >> edge[0] >> edge[1] >> edge[2]) {
    std::sort(edge.begin(), edge.end(), std::greater<int>());

    int largest = edge[0] * edge[0], others = edge[1] * edge[1] + edge[2] * edge[2];

    if (edge[0] >= edge[1] + edge[2]) {
      break;
    }
    else if (largest == others) {
      tri[1]++;
    }
    else if (largest < others) {
      tri[2]++;
    }
    else if (largest > others) {
      tri[3]++;
    }

    tri[0]++;
  }

  cout << tri << endl;

  return 0;
}

C++: #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;a++) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	vector <int>a(3);
	int choku = 0, ei = 0, don = 0;
	while (cin >> a[0] >> a[1] >> a[2]) {
		Sort(a);
		if (a[0] + a[1] <= a[2])
		{
		break;
		}
		int a2[3];
		rep(i, 3) {
			a2[i] = a[i] * a[i];
		}
		if (a2[0] + a2[1] == a2[2]) 
		{ 
			choku++;
		}
		else if (a2[0] + a2[1] > a2[2]) 
		{ 
			ei++;
	//cout << "shine" << endl;
		}
		else 
		{
			don++;
		}
	}
	cout << choku + ei + don << " " << choku << " " << ei << " " << don << endl;
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n;
	int a,b,c;
	int d,e,f;
	int s;
	int i;
	int cnt,cnt1,cnt2,cnt3;
	cnt=cnt1=cnt2=cnt3=0;
	
	while(scanf("%d %d %d",&a,&b,&c)!=EOF){
		//for(i=0;i<5;i++){
			d=a*a;
			e=b*b;
			f=c*c;
			if(c>=a && c>=b && c<a+b || b>=a && b>=c && b<c+a || a>=c && a>=b && a<b+c){
				cnt++;
				if(c>=a && c>=b){
					s=f-d-e;
					if(s==0){
						cnt1++;
					}
					else if(s<0){
						cnt2++;
					}
					else if(s>0){
						cnt3++;
					}
				}
				else if(b>=a && b>=c){
					s=e-d-f;
					if(s==0){
						cnt1++;
					}
					else if(s<0){
						cnt2++;
					}
					else if(s>0){
						cnt3++;
					}
				}
				else if(a>=c && a>=b){
					s=d-f-e;
					if(s==0){
						cnt1++;
					}
					else if(s<0){
						cnt2++;
					}
					else if(s>0){
						cnt3++;
					}
				}
			}
			else if(c>=a && c>=b && c>=a+b || b>=a && b>=c && b>=c+a || a>=c && a>=b && a>=b+c){
				break;
			}
		//}
	}
	printf("%d %d %d %d\n",cnt,cnt1,cnt2,cnt3);
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int a[100], b[100], c[100],d,e,f,n;
	n = 0;
	d = 0;
	e = 0;
	f = 0;
	while (n <= 100)
	{
	A:
		cin >> a[n] >> b[n] >> c[n];
		if (a[n] + b[n] <= c[n] || a[n] + c[n] <= b[n] || b[n] + c[n] <= a[n])
		{
			break;
		}
		else
		{
			if (a[n] * a[n] + b[n] * b[n] == c[n] * c[n] || a[n] * a[n] + c[n] * c[n] == b[n] * b[n] || b[n] * b[n] + c[n] * c[n] == a[n] * a[n])
			{
				d++;
				n++;
				goto A;
			}
		    if (a[n] * a[n] + b[n] * b[n] > c[n] * c[n] || a[n] * a[n] + c[n] * c[n] > b[n] * b[n] || b[n] * b[n] + c[n] * c[n] > a[n] * a[n])
			{
				e++;
				f = f - 1;
				n++;
				goto A;
			}
			if (a[n] * a[n] + b[n] * b[n] < c[n] * c[n] || a[n] * a[n] + c[n] * c[n] < b[n] * b[n] || b[n] * b[n] + c[n] * c[n] < a[n] * a[n]) 
			{
				f++;
				n++;
				goto A;
			}
		}
	}
	cout << n<<" "<<d<<" "<<e<<" "<<f<<endl;
	return 0;
}

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

int a, b, c, s, x, y;
int d = 0, e = 0, t = 0;

int main() {

	while (1) {
		cin >> a >> b >> c; //各辺の入力

		if (a + b <= c)		//aとbを固定して三角形の条件式
			break;

		x = a ^ 2 + b ^ 2;	//aとbを固定して計算
		y = c ^ 2;			//cを固定して計算

		if (x < y)
			e++;
		if (x == y)
			t++;
		if (x > y)
			d++;
	}

	s = d + e + t;
	cout << s << " " << t << " " << e << " " << d << endl;

	return 0;

}