Go: package main

import (
	"fmt"
	"sort"
)

// TriangleKind kind of triangle
type TriangleKind int

const (
	// Nothing not triangle
	Nothing TriangleKind = iota
	// RightTriangle the right triangle
	RightTriangle
	// SharpTriangle the sharp triangle
	SharpTriangle
	// ObtuseTriangle the obtuse triangle
	ObtuseTriangle
) // const for Triangle kind

type result struct {
	rTriangle int
	sTriangle int
	oTriangle int
}

func (res *result) String() string {
	return fmt.Sprintf("%d %d %d %d", res.rTriangle+res.sTriangle+res.oTriangle, res.rTriangle, res.sTriangle, res.oTriangle)
}

func checkTriangleType(a int, b int, c int) TriangleKind {
	p := []int{a, b, c}
	sort.Sort(sort.IntSlice(p))
	if !(p[0]+p[1] > p[2] && p[1]+p[2] > p[0] && p[2]+p[0] > p[1]) {
		return Nothing
	}

	c = (p[0] * p[0]) + (p[1] * p[1]) - (p[2] * p[2])
	if c == 0 {
		return RightTriangle
	}
	if c > 0 {
		return SharpTriangle
	}
	return ObtuseTriangle
}

func main() {
	var res = new(result)
	var a, b, c int
	var hasNext = true
	for hasNext {
		fmt.Scanf("%d %d %d", &a, &b, &c)
		switch checkTriangleType(a, b, c) {
		case Nothing:
			hasNext = false
		case RightTriangle:
			res.rTriangle++
		case SharpTriangle:
			res.sTriangle++
		case ObtuseTriangle:
			res.oTriangle++
		}
	}
	fmt.Println(res.String())
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a[3],w=0,x=0,y=0,z=0,b=0;
  while(b==0){
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    if(a[2]<a[0]+a[1]&&b==0){
      w++;
      if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1])x++;
      if(a[2]*a[2]>a[0]*a[0]+a[1]*a[1])z++;
      if(a[2]*a[2]<a[0]*a[0]+a[1]*a[1])y++;
    }else b++;
  }
  cout<<w<<" "<<x<<" "<<y<<" "<<z<<endl;
}

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

using namespace std;

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

bool calc(){
  for(int i=0;i<3;i++){
    if(a[i] + a[(i+1)%3] <= a[(i+2)%3]) return false;
  }
  cnt[0]++;
  if(a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) cnt[1]++;
  if(a[0] * a[0] + a[1] * a[1] > a[2] * a[2]) cnt[2]++;
  if(a[0] * a[0] + a[1] * a[1] < a[2] * a[2]) cnt[3]++;
  return true;
}

main(){
  fill(cnt, cnt+4, 0);
  bool f = true;
  while(cin >> a[0] >> a[1] >> a[2]){
    sort(a, a+3);
    if(f){
      if(!calc()) f = false;
    }
  }
  for(int i=0;i<4;i++){
    if(i) cout << ' ';
    cout << cnt[i];
  }
  cout << endl;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
#include <deque>
#include <complex>
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define REP(i,a) FOR(i,0,a)
using namespace std;
int norm(int a){return a*a;}
int main() {
	int s[3],type[3]={},sum=0;
	while(true){
	REP(i,3)
			cin >>s[i];
	sort(s,s+3);
	if(s[0]+s[1]<=s[2])
		break;
	if(norm(s[0])+norm(s[1])==norm(s[2]))
	type[0]++;
	if(norm(s[0])+norm(s[1])<norm(s[2]))
	type[2]++;
	if(norm(s[0])+norm(s[1])>norm(s[2]))
	type[1]++;
	
	sum++;
	}
	cout <<sum;
	REP(i,3)
		cout <<" " << type[i];
	cout << endl;
	// your code goes here
	return 0;
}

C++: #include<cstdio>
int main() {
	int a, b, c, tmp, triangle = 0, right = 0, acute = 0, obtuse = 0;
	while (true) {
		scanf("%d%d%d", &a, &b, &c);
		if (a > b) { tmp = b; b = a; a = tmp; }
		if (b > c) { tmp = c; c = b; b = tmp; }
		if (a > b) { tmp = b; b = a; a = tmp; }
		if (a + b <= c) {
			printf("%d %d %d %d\n", triangle, right, acute, obtuse);
			break;
		}
		else if (a*a + b*b > c*c) acute++;
		else if (a*a + b*b == c*c) right++;
		else obtuse++;
		triangle++;
	}
	return 0;
}

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

int main(){

	bool flg = true;

	int r1 = 0, r2 = 0, r3 = 0;

	int data[3];
	while (std::cin >> data[0] >> data[1] >> data[2]){
		if (!flg)continue;

		std::sort(data, data + 3);

		if (data[2] >= data[1] + data[0]){
			std::cout << r1 + r2 + r3 << " " << r2 << " " << r1 << " " << r3 << std::endl;
			flg = false;
		}

		if (data[2] * data[2] < data[1] * data[1] + data[0] * data[0])r1++;
		if (data[2] * data[2] == data[1] * data[1] + data[0] * data[0])r2++;
		if (data[2] * data[2] > data[1] * data[1] + data[0] * data[0])r3++;
	}

	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <iterator>
#include <stack>
using namespace std;

/*
const int MAX=1000;
vector<vector<int> > memo(MAX,vector<int>(MAX));
vector<vector<int> > done(MAX,vector<int>(MAX));
int dfs(vector<vector<int> > vi,int i,int j,int sum);

int main(){
	//ios::sync_with_stdio(false);
	//cin.tie(0);
	int m,n;
	while(cin>>m>>n&&m!=0&&n!=0){
		vector<vector<int> > ice(m,vector<int>(n));
		int ans=0;
		for(int i=0; i<MAX; ++i){
			for(int j=0; j<MAX; ++j){
				memo[i][j]=0;
				done[i][j]=0;
			}
		}
		for(int i=0; i<n; ++i){
			for(int j=0; j<m; ++j){
				cin >> ice[j][i];
			}
		}
		for(int i=0; i<n; ++i){
			for(int j=0; j<m; ++j){
				if(ice[i][j]==1) {
					ans=max(ans,dfs(ice,i,j,0));
				}
			}
		}
		cout << ans << "\n";
	}
	return 0;
}

int dfs(vector<vector<int> > vi,int i,int j,int sum){
	if(done[i][j]==1) return memo[i][j];
	if(i+1>=vi.size()&&j+1>=vi[i].size()&&i-1<0&&j-1<0&&vi[i+1][j]==0&&vi[i][j+1]==0&&vi[i-1][j]==0&&vi[i][j-1]==0) return sum;
	done[i][j]=1;
	++sum;
	if(i+1<vi.size()) memo[i][j]=dfs(vi,i+1,j,sum+1);
	if(j+1<vi[i].size()) memo[i][j]=dfs(vi,i,j+1,sum+1);
	if(i-1>=0) memo[i][j]=dfs(vi,i-1,j,sum+1);
	if(j-1>=0) memo[i][j]=dfs(vi,i,j-1,sum+1);
	return memo[i][j]; 
}
*/

int main(){
	vector<int> n(3);
	vector<int> cnt(4);
	while(cin>> n[0] >> n[1] >> n[2]){
		int MAX;
		if(n[0]>=n[1]&&n[0]>=n[2]) {
			MAX=n[0];
			if(MAX>=n[1]+n[2]) break;
			if(MAX*MAX==n[1]*n[1]+n[2]*n[2]) ++cnt[1];
			if(MAX*MAX<n[1]*n[1]+n[2]*n[2]) ++cnt[2];
			if(MAX*MAX>n[1]*n[1]+n[2]*n[2]) ++cnt[3];
		}
		else if(n[1]>=n[0]&&n[1]>=n[2]) {
			MAX=n[1];
			if(MAX>=n[0]+n[2]) break;
			if(MAX*MAX==n[0]*n[0]+n[2]*n[2]) ++cnt[1];
			if(MAX*MAX<n[0]*n[0]+n[2]*n[2]) ++cnt[2];
			if(MAX*MAX>n[0]*n[0]+n[2]*n[2]) ++cnt[3];
		}
		else if(n[2]>=n[0]&&n[2]>=n[1]) {
			MAX=n[2];
			if(MAX>=n[0]+n[1]) break;
			if(MAX*MAX==n[1]*n[1]+n[0]*n[0]) ++cnt[1];
			if(MAX*MAX<n[1]*n[1]+n[0]*n[0]) ++cnt[2];
			if(MAX*MAX>n[1]*n[1]+n[0]*n[0]) ++cnt[3];
		}
		++cnt[0];
	}
	for(int i=0; i<4; ++i){
		cout << cnt[i];
		if(i!=3) cout << " ";
	}
	cout << "\n";
	return 0;
}

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

int main() {
	int a, b, c;
	a = b = c = 0;
	while (1) {
		int k[3];
		for (int d = 0; d < 3; d++)cin >> k[d];
		sort(k, k + 3);
		if (k[0] + k[1] <= k[2]) { printf("%d %d %d %d\n", a + b + c, b, a, c); return 0; }
		int e = k[0] * k[0] + k[1] * k[1], f = k[2] * k[2];
		if (e < f)a++;
		else if (e == f)b++;
		else c++;
	}
}

C++: #include<iostream>
using namespace std;
int main() {
    int cnt = 0, cnt1 = 0, cnt2 = 0, cnt3 = 0;
    while (1) {
        int a, b, c;
        cin >> a >> b >> c;
        if (a > b) {
            swap(a, b);
        }
        if (b > c) {
            swap(b, c);
        }
        double d = (double)(a * a + b * b - c * c) / (2 * a * b);
        if (d <= -1 || d >= 1) {
            cout << cnt << " " << cnt1 << " " << cnt2 << " " << cnt3 << endl;
            return 0;
        } else if (d == 0) {
            cnt++;
            cnt1++;
        } else if (0 < d && d < 1) {
            cnt++;
            cnt2++;
        } else {
            cnt++;
            cnt3++;
        }
    }
 }