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 FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF (1<<29)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
const int dx[] = {-1,0,0,1},dy[] = {0,1,-1,0};

typedef long long int ll;

using namespace std;

int main(){
    int choku,ei,don,no;
    choku = 0;
    ei = 0;
    don = 0;
    no = 0;
    while(true){
	int a,b,c;
	cin >> a >> b >> c;
	if(cin.eof()) break;
	if(a > c) swap(a,c);
	if(b > c) swap(b,c);
	if(a+b <= c) break;
	else{
	    a = a * a;
	    b = b * b;
	    c = c * c;
	    if(a + b == c) choku++;
	    else if(a + b < c) don++;
	    else if(a + b > c) ei++;
	}
    }
    printf("%d %d %d %d\n",choku+don+ei,choku,ei,don);
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>

using namespace std;

int a[3];
int cnt[4];

int main(void){

	while(~scanf("%d%d%d",&a[0],&a[1],&a[2])){
		sort(a,a+3,greater<int>());
		if(a[1]+a[2]>a[0]){
			cnt[0]++;
			if(a[1]*a[1]+a[2]*a[2]==a[0]*a[0])cnt[1]++;
			else if(a[1]*a[1]+a[2]*a[2]>a[0]*a[0])cnt[2]++;
			else cnt[3]++;
		}else break;
	}
	printf("%d %d %d %d\n",cnt[0],cnt[1],cnt[2],cnt[3]);
	return 0;
}

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

using std::begin;
using std::end;

std::tuple<int, int, int> sort(int a, int b, int c) {
  int xs[] = {a, b, c};
  std::sort(begin(xs), end(xs));
  return std::make_tuple(xs[0], xs[1], xs[2]);
}

int main(int, char**) {
  int a, b, c;
  int cnt{0}, ei{0}, cho{0}, don{0};

  while(std::cin >> a >> b >> c) {
    auto t = sort(a, b, c);
    {
      int a, b, c;
      std::tie(a, b, c) = t;
      if(a + b == c) break;
      ++cnt;
      int m2 = a * a + b * b;
      if(m2 == c * c) ++cho;
      else if(m2 > c * c) ++ei;
      else ++don;
    }
  }

  std::cout << cnt << ' ' << cho << ' ' << ei << ' ' << don << std::endl;
}

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

int Solve(int a,int b,int c){

  if(c*c < a*a+b*b )return 1;
  if(c*c == a*a+b*b)return 0;
  else return 2;

}

int main(){

  int sum[]={0,0,0};
  vector< int > a(3);

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

    if(a[0]+a[1] > a[2]){
      sum[ Solve(a[0],a[1],a[2]) ] ++;
    }
    else{
      break;
    }

  }

  cout << sum[0]+sum[1]+sum[2] << ' ' << sum[0] << ' ' << sum[1] << ' ' << sum[2] << endl;

  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
const int N=3;

int main() {
  std::ios::sync_with_stdio(false);
  cout.tie(0); cin.tie(0);
  int Triangle=0,RightangledTriangle=0,AcuteangleTriangle=0,ObtuseTriangle=0;
  int threeSides[N];
  bool flag=true;
  while (flag) {
    cin>>threeSides[0]>>threeSides[1]>>threeSides[2];
    sort(threeSides,threeSides+N);
    if (threeSides[1]+threeSides[2]>threeSides[0]&&threeSides[0]+threeSides[2]>threeSides[1]&&threeSides[0]+threeSides[1]>threeSides[2]) {
      Triangle++;
      if (pow(threeSides[2],2)==pow(threeSides[0],2)+pow(threeSides[1],2)) {
	RightangledTriangle++;
      }
      else if (pow(threeSides[2],2)<pow(threeSides[0],2)+pow(threeSides[1],2)) {
	AcuteangleTriangle++;
      }
      else {
	ObtuseTriangle++;
      }
    }
    else flag=false;
  }
  cout<<Triangle<<" "<<RightangledTriangle<<" "<<AcuteangleTriangle<<" "<<ObtuseTriangle<<endl;
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <map>
#include <functional>
#include <cmath>
#include <cstdio>
using namespace std;

#define PI 4*atan(1);

int main(){
  int n[3], max = 0;
  int cnt[3] = {0}, ans = 0;
  while(1){
    //n[0]: 直角三角形, n[1]: 鋭角三角形, n[2], 鈍角三角形
    cin >> n[0] >> n[1] >> n[2];
    if(n[0] < n[1] + n[2] && n[1] < n[0] + n[2] && n[2] < n[0] + n[1]){
      sort(n, n + 3);
      int sum = n[0] * n[0] + n[1] * n[1] - n[2] * n[2];
      if(sum > 0){
        cnt[1]++;
        ans++;
      }else if(sum == 0){
        cnt[0]++;
        ans++;
      }else{
        cnt[2]++;
        ans++;
      }
    }else{
      cout << ans << " " << endl;
      for(int i = 0; i < 2; i++){
        cout << cnt[i] << " " << endl;
      }
      cout << cnt[2] << endl;
      break;
    }
  }

}

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)
	{
		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
		{
			n++;
			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++;
			}
			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++;
			}
			else f++;
		}
	}
	cout << n<<" "<<d<<" "<<e<<" "<<f<<endl;
	return 0;
}