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 <algorithm>
#include <cstdio>
#include <cstdlib>
using namespace std;

constexpr inline int square(int x) {
	return x * x;
}

int main() {
	int edge[3];
	int triangle = 0;
	int right	 = 0;
	int acute	 = 0;
	int obtuse	 = 0;

	while(scanf("%d %d %d", edge, edge + 1, edge + 2) == 3) {
		sort(edge, edge + 3);

		if(edge[0] + edge[1] <= edge[2]) {
			printf("%d %d %d %d\n", triangle, right, acute, obtuse);
			break;;
		}

		++triangle;
		const int a = square(edge[0]) + square(edge[1]);
		const int b = square(edge[2]);

		if(a == b) ++right;
		else if(a > b) ++acute;
		else ++obtuse;
	}

	return EXIT_SUCCESS;
}

C++: #include<bits/stdc++.h>

using namespace std;

int main(){

  vector<int> a(3);
  int w = 0;
  int x = 0;
  int y = 0;
  int z = 0;

  while(1){
    cin >> a[0] >> a[1] >> a[2];
  
    if(a[0]+a[1] > a[2] && a[1]+a[2] > a[0] && a[2]+a[0] > a[1]){
      w++;

      sort(a.begin(),a.end());

      if(a[2]*a[2] == a[0]*a[0] + a[1]*a[1])
	x++;
      else if(a[2]*a[2] < a[0]*a[0] + a[1]*a[1])
	y++;
      else if(a[2]*a[2] > a[0]*a[0] + a[1]*a[1])
	z++;
    }
    else
      break;
  }

  cout << w << " " << x << " " << y << " " << z << endl;
  
}

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

int main()
{
  int a, b, c;
  int x = 0, y = 0, z = 0, w = 0;
  while (true)
  {
    cin >> a >> b >> c;
    int len = a + b + c;
    int nmax = max(a, max(b, c));
    int nmin = min(a, min(b, c));
    int nmid = len - nmax - nmin;
    if (nmax < nmin + nmid)
    {
      x++;
      if (nmin * nmin + nmid * nmid == nmax * nmax)
        y++;
      else if (nmin * nmin + nmid * nmid > nmax * nmax)
        z++;
      else
        w++;
    }
    else
      break;
  }

  cout << x << ' ' << y << ' ' << z << ' ' << w << endl;

  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] << " ";
	}
	cout << "\n";
	return 0;
}

C++: #include<iostream>
#include<cmath>
#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( pow(Length[0], 2) + pow(Length[1], 2) == pow(Length[2], 2) )
	Triangle[1]++;
	
	else if( pow(Length[0], 2) + pow(Length[1], 2) < pow(Length[2], 2) )
	Triangle[2]++;
	
	else
	Triangle[3]++;
	
	}
	Triangle[0] += ( Triangle[1] + Triangle[2] + Triangle[3] );
	cout << Triangle[0] << " " << Triangle[1] << " "
		 << Triangle[2] << " " << Triangle[3] << "\n";
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
int main() {
	vector<int> a(3);
	int sya, el,ei=0,tyo=0,don=0;
	while (1) {
		for (int i = 0; i < 3; ++i) {
			cin >> a[i];
		}
		sort(a.begin(), a.end());
		el = pow(a[0], 2) + pow(a[1], 2);
		sya = pow(a[2], 2);
		if (a[0] + a[1] <= a[2])break;
		else if (sya == el)tyo++;
		else if (sya < el)ei++;
		else if (sya > el)don++;
	}
	cout << tyo + ei + don << " " << tyo << " " << ei << " " << don << endl;

	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)
	{
		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++;
			}
			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])
			{
				e++;
			}
			else f++;
		}
	}
	cout << n<<" "<<d<<" "<<e<<" "<<f<<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])y++;
			else if (a[0] * a[0] + a[1] * a[1] <= a[2] * a[2])z++;
			else if (a[0] * a[0] + a[1] * a[1] >= a[2] * a[2])x++;
		}
		cout << t << ' ' << x << ' ' << y << ' ' << z << endl;
	}
	cout << t << ' ' << x << ' ' << y << ' ' << z << endl;
}