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>
#include <vector>
#include <algorithm>

using namespace std;

void solve()
{
	vector<int> edge(3);
	int triangle = 0;
	int right_triangle = 0;
	int acute_triangle = 0;
	int obtuse_triangle = 0;
	while(cin >> edge[0] >> edge[1] >> edge[2])
	{
		if(edge[0] + edge[1] > edge[2] && edge[1] + edge[2] > edge[0] && edge[2] + edge[0] > edge[1])
		{
			++triangle;
		}
		else
		{
			break;
		}
		sort(edge.begin(), edge.end());
		double cos_theta = (double)(edge[0] * edge[0] + edge[1] * edge[1] - edge[2] * edge[2]) / (2 * edge[0] * edge[1]);
		if( edge[0] * edge[0] + edge[1] * edge[1] == edge[2] * edge[2] ||
			edge[1] * edge[1] + edge[2] * edge[2] == edge[0] * edge[0] ||
			edge[2] * edge[2] + edge[0] * edge[0] == edge[1] * edge[1])
		{
			++right_triangle;
		}
		else if(cos_theta < 0)
		{
			++obtuse_triangle;
		}
		else
		{
			++acute_triangle;
		}
	}
	cout << triangle << " " << right_triangle << " " << acute_triangle << " " << obtuse_triangle << endl;
}

int main()
{
	solve();
	return(0);
}

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

using namespace std;

int main(int argc, char const *argv[]) {
    int edge[3];
    int tri[3]={0};//0:right, 1:acute, 2:obtuse
    int total=0;

    while(1){
        for(int i=0;i<3;i++)
            cin >> edge[i];
        sort(edge,edge+3);
        if(edge[2] < edge[0] + edge[1]){
            total++;
            if(pow(edge[2],2) == pow(edge[0],2) + pow(edge[1],2)){
                tri[0]++;
            }else if(pow(edge[2],2) < pow(edge[0],2) + pow(edge[1],2)){
                tri[1]++;
            }else{
                tri[2]++;
            }
        }else{
            break;
        }
    }
    printf("%d %d %d %d\n",total,tri[0],tri[1],tri[2]);
    return 0;
}

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

int main() {
    int INF = 100000;
    int a[INF], b[INF], c[INF];
    for (int i = 0; i < INF; ++i) {
        cin >> a[i] >> b[i] >> c[i];
        if (a[i] > b[i]) {
            int t = a[i];
            a[i] = b[i];
            b[i] = t;
        }
        if (b[i] > c[i]) {
            int t = b[i];
            b[i] = c[i];
            c[i] = t;
        }
        if (a[i] > b[i]) {
            int t = a[i];
            a[i] = b[i];
            b[i] = t;
        }
    }

    int tr = 0, ttr = 0, etr = 0, dtr = 0;
    for (int i = 0; i < INF; ++i) {
        if (c[i] >= a[i] + b[i]) {
            cout << tr << " " << ttr << " " << etr << " " << dtr << endl;
            break;
        }
        else if (c[i] * c[i] > a[i] * a[i] + b[i] * b[i]) {
            ++tr;
            ++dtr;
        }
        else if (c[i] * c[i] == a[i] * a[i] + b[i] * b[i]) {
            ++tr;
            ++ttr;
        }
        else if (c[i] * c[i] < a[i] * a[i] + b[i] * b[i]) {
            ++tr;
            ++etr;
        }
    }
    
    return 0;
}

C++: #include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int a[3], p, q, r;
int main() {
	while (true) {
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		if (a[0] + a[1] <= a[2]) { cout << p + q + r << ' ' << p << ' ' << q << ' ' << r << endl; break; }
		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) { p++; }
		if (a[0] * a[0] + a[1] * a[1] > a[2] * a[2]) { q++; }
		if (a[0] * a[0] + a[1] * a[1] < a[2] * a[2]) { r++; }
	}
}

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

bool check(vector<int>& vec)
{
  int a,b,c;
  a = vec[0],b = vec[1],c = vec[2];
  if(a >= b+c || b >= a+c || c >= a+b)
    return false;
  return true;
}

int main()
{
  int _1,_2,_3,_4;
  _1 = _2 = _3 = _4 = 0;
  while(true)
    {
      vector<int> vec;
      for(int i=0;i<3;i++)
	{
	  int a;
	  cin >> a;
	  vec.push_back(a);
	}
      sort(vec.begin(),vec.end());
      if(!check(vec))      
	break;
      int a,b,c;
      a = vec[0],b = vec[1],c = vec[2];

      _1++;
      if(c*c == a*a+b*b)
	_2++;
      if(c*c < a*a+b*b)
	_3++;
      if(c*c > a*a+b*b)
	_4++;

    }
  cout << _1 << " " << _2 << " " << _3 << " " << _4 << endl;
  return 0;
}

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++;
        }
        else if(value<0){
            obtuse++;
        }
        else{
            acute++;
        }
    }
    printf("%d %d %d %d\n",count,right,acute,obtuse);
    return 0;
}

C++: #include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"

#define MOD 1000000007 // 1e9+7
#define PI 3.1415926525
#define ll long long int // 10^18
#define INF 1000000001 // 1e9+1

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
//---------------------------
int a[3],b[4];

int main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  while(true){
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    if(a[2]>=a[0]+a[1])break;
    b[0]++;
    int rec=a[2]*a[2]-a[1]*a[1]-a[0]*a[0];
    if(rec==0)b[1]++;
    if(rec>0)b[3]++;
    if(rec<0)b[2]++;
  }
  REP(i,4){
    cout<<b[i]<<" \n"[i==3];
  }
  return 0;
}

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

using namespace std;

void solve()
{
	vector<int> edge(3);
	int triangle = 0;
	int right_triangle = 0;
	int acute_triangle = 0;
	int obtuse_triangle = 0;
	while(cin >> edge[0] >> edge[1] >> edge[2])
	{
		if(edge[0] + edge[1] > edge[2] && edge[1] + edge[2] > edge[0] && edge[2] + edge[0] > edge[1])
		{
			++triangle;
		}
		else
		{
			break;
		}
		sort(edge.begin(), edge.end());
		double cos_theta = (edge[0] * edge[0] + edge[1] * edge[1] - edge[2] * edge[2]) / (2 * edge[0] + edge[1]);
		if( edge[0] * edge[0] + edge[1] * edge[1] == edge[2] * edge[2] ||
			edge[1] * edge[1] + edge[2] * edge[2] == edge[0] * edge[0] ||
			edge[2] * edge[2] + edge[0] * edge[0] == edge[1] * edge[1])
		{
			++right_triangle;
		}
		else if(cos_theta < 0)
		{
			++obtuse_triangle;
		}
		else
		{
			++acute_triangle;
		}
	}
	cout << triangle << " " << right_triangle << " " << acute_triangle << " " << obtuse_triangle << endl;
}

int main()
{
	solve();
	return(0);
}