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

int main(void) {
	int sharp = 0;
	int obtuse = 0;
	int right = 0;
	int i;
	vector<int> a(3);

	while (1) {
		for (i = 0; i < 3; i++) {
			cin >> a[i];
		}

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

		if (a[0] + a[1] <= a[2] || a[1] + a[2] <= a[0] || a[2] + a[0] <= a[1]) {
			break;
		}

		if (pow(a[0], 2) + pow(a[1], 2) < pow(a[2], 2)) {
			obtuse++;
		}
		else if (pow(a[0], 2) + pow(a[1], 2) == pow(a[2], 2)) {
			right++;
		}
		else {
			sharp++;
		}
	}

	printf("%d %d %d %d\n", right+sharp+obtuse, right, sharp, obtuse);
	return 0;

}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>

using namespace std;

int main(){
	int a,b,c;
	int p=0,p1=0,p2=0,p3=0;
		
	while(1){
		scanf("%d %d %d",&a,&b,&c);
		vector<int> s;
		s.push_back(a);
		s.push_back(b);
		s.push_back(c);
		sort(s.begin(),s.end());
		if(s[0]+s[1]<=s[2]||s[1]+s[2]<=s[0]||s[2]+s[0]<=s[1])
		break;
		else{
			p++;
			for(int i=0;i<3;i++) s[i]=s[i]*s[i];
			if(s[0]+s[1]-s[2]==0)
			p1++;
			else if(s[0]+s[1]-s[2]>0)
			p2++;
			else
			p3++;
		}
	}
	printf("%d %d %d %d\n",p,p1,p2,p3);
}

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

using namespace std;

int main(){
	
	int a[3];
	
	int total[4];
	
	bool checker = true;
	
	for(int i = 0; i < 4; i++){
		total[i] = 0;
	}
	
	while(true){
		cin >> a[0];
		if(cin.eof()){
			break;
		}
		cin >> a[1] >> a[2];
		if(checker){
			sort(a, a + 3);
			if(a[0] + a[1] <= a[2]){
				checker = false;
				continue;
			}
			total[0]++;
			if(a[0] * a[0] + a[1] * a[1] == a[2] * a[2]){
				total[1]++;
			}else if(a[0] * a[0] + a[1] * a[1] > a[2] * a[2]){
				total[2]++;
			}else{
				total[3]++;
			}
		}
	}
	
	printf("%d %d %d %d\n", total[0], total[1], total[2], total[3]);
	
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <map>
#include <functional>
#include <cmath>
#include <cstdio>
using namespace std;

#define PI 4*atan(1);

int main(){
  int n[3], max = 0;
  int cnt[3] = {0}, ans = 0;
  bool t = true;
  while(cin >> n[0] >> n[1] >> n[2]){
    if(t == true){
      if(n[0] < n[1] + n[2] && n[1] < n[0] + n[2] && n[2] < n[0] + n[1]){
        sort(n, n + 3);
        int sum = n[0] * n[0] + n[1] * n[1] - n[2] * n[2];
        if(sum > 0){
          cnt[1]++;
          ans++;
        }else if(sum == 0){
          cnt[0]++;
          ans++;
        }else{
          cnt[2]++;
          ans++;
        }
      }else{
        t = false;
      }
    }else{
    }
  }
  cout << ans << " ";
  for(int i = 0; i < 2; i++){
    cout << cnt[i] << " ";
  }
  cout << cnt[2] << endl;
}

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

int main(){
  int cyo=0;
  int don=0;
  int ei=0;
  int count=0;

  for(int i=0;i<100;i++){
    int t[3];
    cin>>t[0]>>t[1]>>t[2];
    sort(t,t+3);

    if(t[0]+t[1]<=t[2])break;
    else {
      count++;
      t[0]=t[0]*t[0];
      t[1]=t[1]*t[1];
      t[2]=t[2]*t[2];
      if(t[0]+t[1]==t[2])cyo++;
      if(t[0]+t[1]<t[2])ei++;
      if(t[0]+t[1]>t[2])don++;
    }
  }
  cout<<count<<" "<<cyo<<" "<<don<<" "<<ei<<endl;

}

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

int main(){

    bool holds = true;
    vector<int> mem(4,0);//0が三角形の数　１が直角　２が鋭角　３が鈍角
    vector<int> tri(3);

    while(holds){
        vector<int> node(3);
        int a,b,c;
        cin>>node[0]>>node[1]>>node[2];

        for(int i=0;i<3;i++){
            if(node[i] >= node[(i+1)%3] + node[(i+2)%3]){
                holds = false;
            }
            else {
               sort(node.begin(),node.end());
               a = node[2];
               b = node[1];
               c = node[0];
            }
        }

        if(holds){
            mem[0]++;
            if(a*a > b*b + c*c) mem[3]++;
            else if (a*a < b*b + c*c) mem[2]++;
            else mem[1]++;
        }
    }
    for(int i=0;i<3;i++){
        cout<<mem[i]<<" ";
    }
    cout<<mem[3]<<endl;
}

C++: #include<iostream>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int a,b,c;
	long long sharp=0,Dull=0,Ra=0;
	while(1){
		cin>>a>>b>>c;
		if(a+b<=c || b+c<=a || c+a<=b)break;
		int maxnum=max(max(a,b),c);
		if(maxnum==a){
			if(a*a==b*b+c*c)Ra++;
			else if(a*a>b*b+c*c)Dull++;
			else sharp++;
		}else if(maxnum==b){
			if(b*b==c*c+a*a)Ra++;
			else if(b*b>c*c+a*a)Dull++;
			else sharp++;
		}else{
			if(c*c==a*a+b*b)Ra++;
			else if(c*c>a*a+b*b)Dull++;
			else sharp++;
		}
	}
	cout<<sharp+Dull+Ra<<" "<<Ra<<" "<<sharp<<" "<<Dull<<endl;
	return 0;
}