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 <bits/stdc++.h>

#define pout(n)  printf ("%d\n", n)

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)

const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };

#define MAX_N (int)2e5+20

typedef long long ll;
using namespace std;

int r = 0,x = 0,y = 0,z = 0;
vector<int> q(3); 
int main() {
    while(cin >> q[0] >> q[1] >> q[2]){
    sort(q.begin(),q.end());

    if(q[0]+q[1]<=q[2]){
        cout << r << " " << x  << " " << y << " " << z << endl;
        return 0;
    }
    r++;
    if(q[0]*q[0]+q[1]*q[1]==q[2]*q[2]) x++;
    if(q[0]*q[0]+q[1]*q[1] >q[2]*q[2]) y++;
    if(q[0]*q[0]+q[1]*q[1] <q[2]*q[2]) z++;
    }
    return 0;
}

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

using namespace std;

double sideToCos(vector<int> &side)
{
	double a2, b2, c2, cos;
	a2 = side[0] * side[0];
	b2 = side[1] * side[1];
	c2 = side[2] * side[2];
	cos = (c2 - a2 - b2) / -(2 * side[0] * side[1]);
	return cos;
}

int main() {
	vector<int> side(3);
	int count = 0, right = 0, acute = 0, obtuse = 0;
	double cos;

	while (1)
	{
		cin >> side[0] >> side[1] >> side[2];
		sort(side.begin(), side.end());
		if (side[0] + side[1] <= side[2])
		{
			break;
		}
		else
		{
			count++;
			cos = sideToCos(side);
			if (cos > 0) acute++;
			else if (cos < 0) obtuse++;
			else right++;
		}
	}
	cout << count << ' ' << right << ' ' << acute << ' ' << obtuse << 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;
	}
	cout << t << ' ' << x << ' ' << y << ' ' << z << endl;
}

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

int main() {
    int sides[3], sum[4] = {0, 0, 0, 0};
    bool isOver = false;
    while(scanf("%d %d %d", &sides[0], &sides[1], &sides[2]) != EOF) {
        sort(sides, sides+3);
        if (sides[0] + sides[1] <= sides[2] ||
            sides[0] + sides[2] <= sides[1] ||
            sides[1] + sides[2] <= sides[0] || isOver)  { isOver = true; continue; };
        sum[0]++;
        sides[0]*= sides[0]; sides[1]*=sides[1]; sides[2]*=sides[2];
        if (sides[0] + sides[1] == sides[2]) sum[1]++;
        else if (sides[0]+sides[1] > sides[2]) sum[2]++;
        else if (sides[0]+sides[1] < sides[2]) sum[3]++;
    }
    printf("%d %d %d %d\n", sum[0], sum[1], sum[2], sum[3]);
    return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    int num[3];
    int sankaku=0,eikaku=0,tyokkaku=0,donkaku=0;
    while(1){
        scanf("%d %d %d", num,num+1,num+2);
        sort(num,num+3);
        if(num[0]+num[1] <= num[2]){
            printf("%d %d %d %d\n",sankaku,tyokkaku,eikaku,donkaku);
            return 0;
        }
        sankaku+=1;
        if(num[0]*num[0] + num[1]*num[1] > num[2]*num[2]) eikaku+=1;
        if(num[0]*num[0] + num[1]*num[1] == num[2]*num[2]) tyokkaku+=1;
        if(num[0]*num[0] + num[1]*num[1] < num[2]*num[2]) donkaku+=1;
    }
}

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++;
        }
        if(value<0){
            obtuse++;
        }
        else{
            acute++;
        }
    }
    printf("%d %d %d %d\n",count,right,acute,obtuse);
    return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){

  int a,b,c;
  int X,Y,Z;
  int count1=0,count2=0,count3=0,count=0;

  while(cin >> a >> b >> c   ){
    
    if(a>=b && a>=c){
      X=a;Y=b;Z=c;}
    else if(b>=a && b>=c){
      X=b;Y=a;Z=c;}
    else if(c>=a && c>=b){
      X=c;Y=b;Z=a;}
    if(X>=Y+Z)break;
    else{count++;


    if(X*X==Y*Y+Z*Z){
      count1++;
      
    }
    else if(X*X< Y*Y +Z*Z){
      count2++;}
    else if(X*X> Y*Y +Z*Z){
      count3++;}
    }
  
  }

  cout << count << " " << count1 << " " << count2 << " " << count3 << endl;    
    
  return 0;
}

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

int main() {
  bool flag = true;
  int san = 0, cho = 0, ei = 0, don = 0;
  while (flag) {
    int a, b, c; cin >> a >> b >> c;
    // sankakkei
    if (a + b > c && b + c > a && c + a > b) {
      san++;
      vector<int> v = {a, b, c};
      sort(v.begin(), v.end(), greater<int>());
      //chokkaku
      if (v.at(0) * v.at(0) == v.at(1) * v.at(1) + v.at(2) * v.at(2)) {
        cho++;
      }
      //eikaku
      if (v.at(0) * v.at(0) < v.at(1) * v.at(1) + v.at(2) * v.at(2)) {
        ei++;
      }
      //donkaku
      if (v.at(0) * v.at(0) > v.at(1) * v.at(1) + v.at(2) * v.at(2)) {
        don++;
      }
    } else {
      flag = false;
    }
  }
  cout << san << " " << cho << " " << ei << " " << don << endl;
}

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