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 <iostream>
using namespace std;
int main(){
	int a[3],i,j,ans[4]={0};
	while(cin >> a[0] >> a[1] >> a[2]){
		for(i=0;i<3;i++){
			for(j=i+1;j<3;j++){
				if(a[i]>a[j])swap(a[i],a[j]);
			}
		}
		if(a[0]+a[1]>a[2]){
			ans[0]++;
			if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])ans[1]++;
			if(a[0]*a[0]+a[1]*a[1]>a[2]*a[2])ans[2]++;
			if(a[0]*a[0]+a[1]*a[1]<a[2]*a[2])ans[3]++;
		}
	}
	for(i=0;i<3;i++){
		cout << a[i] << endl;
	}
	for(i=0;i<3;i++){
		cout << ans[i] << " ";
	}
	cout << ans[3] << endl;
return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
 
using namespace std;
 
int main()
{
	int tris = 0;
	int right_tris = 0;
	int acute_tris = 0;
	int obtuse_tris = 0;
	for( int i = 0; i < 100; i ++)
	{
		int a, b, c;
		cin >> a >> b >> c;

		if( a + b > c && b + c > a && c + a > b )
		{
			tris ++;

			int d = b * b + c * c;
			int aa = a * a;

			if( d == aa )
			{
				right_tris ++;
			}
			else if ( d > aa )
			{
				acute_tris ++;
			}
			else
			{
				obtuse_tris ++;
			}
		}
	}

	cout << tris << " " << right_tris << " " << acute_tris << " " << obtuse_tris << endl;

	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10
#define MAX_N 20000
#define MAX_M 16

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

int ans, ans1, ans2, ans3;
int a, b, c;

int main(){
	bool f = 1;
	while (cin >> a >> b >> c){
		if (f == 0)continue;
		if (a > b)swap(a, b);
		if (b > c)swap(b, c);
		if (a + b > c&&b + c > a&&c + a > b){
			ans++;
			if (a*a + b*b == c*c){
				ans1++;
			}
			else if (a*a + b*b > c*c){
				ans2++;
			}
			else ans3++;
		}
		else f = 0;
	}
	cout << ans << " " << ans1 << " " << ans2 << " " << ans3 << 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]++;
    }
    cout << table[0] << " " << table[1] << " " << table[2] << " " << table[3] << endl;
    return 0;
}

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

const MAX = 10000;
int a[MAX];

BOOL IsRightAngle(int a, int b, int c){
    if(a*a == b*b + c*c) return TRUE;
    if(b*b == a*a + c*c) return TRUE;
    if(c*c == a*a + b*b) return TRUE;
    return FALSE;
}

BOOL IsOBTUSE(int a, int b, int c){
    if(a*a > b*b + c*c) return TRUE;
    if(b*b > a*a + c*c) return TRUE;
    if(c*c > b*b + a*a) return TRUE;
    return FALSE;
}

BOOL IsTriangle(int a, int b, int c){
    if(a+b > c) return TRUE;
    if(a+c > b) return TRUE;
    if(c+b > a) return TRUE;
    return FALSE;
}

void main(){
    for(int i = 0; i<MAX; i++){
        scanf( "%d" ,&a[i]):
    }
    int j = 0;]
    int tri = 0;
    int right = 0;
    int obtuse = 0;
    int acute = 0;
    for(;;){
        if( !IsTriangle(a[j],a[j+1],a[j+2]) ){
            break;
        }
        if( IsOBTUSE(a[j],a[j+1],a[j+2]) ){
            obtuse++;
            tri++;
        }
        else if(IsRightAngle(a[j],a[j+1],a[j+2]) ){
            right++;
            tri++;
        }
        else{
            acute++;
            tri++;
        }
        j += 3;
    }
    printf("%d %d %d %d\n",tri,right,acute,obtuse);
}

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

#define INPUT_FROM_FILE (0)
#if INPUT_FROM_FILE
#include <fstream>
#endif

bool is_triangle(const std::vector<int> &v){
	return (v[0] + v[1] > v[2]);
}


int main(int argc, char **argv){
#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif

	std::vector<int> vec(3);
	int num_triangles = 0;
	int num_acute_angle_triangles = 0;
	int num_right_angle_triangles = 0;
	int num_obtuse_angle_triagles = 0;

	for(;;){
#if INPUT_FROM_FILE
		ifs >> vec[0] >> vec[1] >> vec[2];
#else
		std::cin >> vec[0] >> vec[1] >> vec[2];
#endif
		std::sort(vec.begin(), vec.end());

		if(!is_triangle(vec)){
			break;
		}
		num_triangles++;

		int vec02 = vec[0] * vec[0];
		int vec12 = vec[1] * vec[1];
		int vec22 = vec[2] * vec[2];
		int sum = vec02 + vec12;

		if(sum < vec22){
			num_obtuse_angle_triagles++;
		}
		else if(sum == vec22){
			num_right_angle_triangles++;
		}
		else{
			num_acute_angle_triangles++;
		}
	}

	std::cout << num_triangles << " " << num_right_angle_triangles << " " << num_acute_angle_triangles << " " << num_obtuse_angle_triagles << std::endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	int a[3];
	int x = 0, y = 0, z = 0;
	while (1) {
		rep(i, 3)cin >> a[i];
		sort(a, a + 3);
		if (a[0] + a[1] <= a[2])break;
		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 z++;
	}
	cout << x + y + z << ' ' << x << ' ' << y << ' ' << z << endl;
	return 0;
}