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>

#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;
}