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;

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 <algorithm>
using namespace std;

int san = 0;
int a[3];
int inu = 0;
int saru = 0;
int kiji = 0;

int main(){
	while (true){
		for (int i = 0; i < 3; i++){
			cin >> a[i];
		}
		sort(a, a + 3);
		if (a[3] * a[3] < a[2] * a[2] + a[1] * a[1] && a[3] < a[1] + a[2]){
			san = san + 1;
			saru = saru + 1;
		}if (a[3] * a[3] == a[2] * a[2] + a[1] * a[1] && a[3] < a[1] + a[2]){
			san = san + 1;
			inu = inu + 1;
		}if (a[3] * a[3] > a[2] * a[2] + a[1] * a[1] && a[3] < a[1] + a[2]){
			san = san + 1;
			kiji = kiji + 1;
		}if (a[3] > a[1] + a[2]){
			break;
		}
	}
	cout << san << " " << inu << " " << saru << " " << kiji << endl;
}

C++: #include <bits/stdc++.h>
#define sqr(x) ((x) * (x))
using namespace std;
int a[3], p, q, r;
int main() {
	ios::sync_with_stdio(false);
	while(cin >> a[0] >> a[1] >> a[2]) {
		sort(a, a + 3);
		if(a[0] + a[1] <= a[2]) break;
		if(sqr(a[0]) + sqr(a[1]) == sqr(a[2])) p++;
		else if(sqr(a[0]) + sqr(a[1]) > sqr(a[2])) q++;
		else r++;
	}
	cout << p + q + r << ' ' << p << ' ' << q << ' ' << r << endl;
	return 0;
}

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

int main(){
  std::vector<int> v(3);
  int a,b,c;
  a=b=c=0;
  for(int i=0;i<100;i++){
    cin>>v[0]>>v[1]>>v[2];
    sort(v.begin(),v.end());
    if(v[2]>=v[0]+v[1]){
      cout<<i<<" "<<a<<" "<<b<<" "<<c<<endl;
      break;
    }
    else{
      if(v[2]*v[2]==v[0]*v[0]+v[1]*v[1])a++;
      if(v[2]*v[2]<v[0]*v[0]+v[1]*v[1])b++;
      if(v[2]*v[2]>v[0]*v[0]+v[1]*v[1])c++;
    }
  }
}

C++: #include<stdio.h>
 
int main(){
	int a[3], b, i, j, e = 0, f = 0, g = 0, h = 0;
	while(scanf("%d %d %d", &a[0], &a[1], &a[2]) != EOF){
		for(i = 0; i < 2; i++){
			for(j = i + 1; j < 3; j++){
				if(a[i] < a[j]){
					b = a[i];
					a[i] = a[j];
					a[j] = b;
				}
			}
		}
		if(a[0] >= a[1] + a[2]) break;
		else e++;
		if(a[0] * a[0] > a[1] * a[1] + a[2] * a[2]) f++;
		else if(a[0] * a[0] == a[1] * a[1] + a[2] * a[2]) g++;
		else h++;
	}
	printf("%d %d %d %d\n", e, g, h, f);
	return 0;
}

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

int main() {
	// your code goes here
	int ch, ei, don;
	int n = 0;
	ch = 0;
	ei = 0;
	don = 0;
	
	while (true) {
		vector <int> l(3);
		cin >> l[0];
		cin >> l[1];
		cin >> l[2];
		std::sort(l.begin(), l.end());
		if (l[0] + l[1] > l[2] && l[1] + l[2] > l[0] && l[2] + l[0] > l[1]) {
			n++;
			if (l[2] * l[2] == l[0] * l[0] + l[1] * l[1]) {
				ch++;
			} else if (l[2] * l[2] > l[0] * l[0] + l[1] * l[1]) {
				don++;
			} else {
				ei++;
			}
		} else {
			break;
		}
	}
	cout << n << " " << ch << " " << ei << " " << don << 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])x++;
			else if (a[0] * a[0] + a[1] * a[1] >= a[2] * a[2])z++;
		}
	}
	cout << t << ' ' << x << ' ' << y << ' ' << z << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,count1=0,count2=0,count3=0,count4=0;
  while(cin>>a>>b>>c ){
      int ia,ib,ic,max,z;
      ia=a*a;
      ib=b*b;
      ic=c*c;
      if(ia>=ib && ia>=ic) {
	if(a<b+c) {
	  max=ia;
	  ia=ic;
	}
	else break;
      }
      
      else if(ib>=ia && ib>=ic) {
	if(b<a+c) {
	  max=ib;
	  ib=ic;
	}
	else break;
      }
      else if(ic>=ia && ic>=ib) {
	if(c<a+b) {
	  max=ic;
	}
	else break;
      }
      else break;
      count1++;
      if(max==ia+ib) count2++;
      else if(max<ia+ib) count3++;
      else count4++;
      break;
  }
  cout<<count1<<" "<<count2<<" "<<count3<<" "<<count4<<endl;
  return 0;
  
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int a[3];
int cnt,b,c,d;
main()
{
    while(cin>>a[0]>>a[1]>>a[2])
    {
        sort(a,a+3);
        if(a[0]+a[1]<=a[2])
        {
            cout<<cnt<<" "<<b<<" "<<c<<" "<<d<<endl;
            return 0;
        }
        cnt++;
        for(int i=0;i<3;i++)a[i]*=a[i];
        if(a[0]+a[1]==a[2])b++;
        else if(a[0]+a[1]<a[2])d++;
        else c++;
    }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  vector<int> hen(3),ans(4);
  fill(ans.begin(),ans.end(),0);

  while(cin >> hen[0] >> hen[1] >> hen[2]){

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

    if(hen[2] < hen[0] + hen[1]){
      ans[0]++; 
      if(hen[2]*hen[2] < hen[0]*hen[0] + hen[1]*hen[1]){
	ans[2]++;
      }else if(hen[2]*hen[2] > hen[0]*hen[0] + hen[1]*hen[1]){
	ans[3]++;
      }else ans[1]++;

    }else break;
  }
  for(int i = 0 ; i < 4 ; i++ ){
    if(i == 0)cout << ans[0];
    else cout <<' '<< ans[i];
  }
  cout << endl;

  return 0;
}

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

int main(){
  vector<int> a(3);
  int cnt[4] = {0, 0, 0, 0};
  while (cin >> a[0] >> a[1] >> a[2]) {
    if (a[0] + a[1] > a[2] && a[0] + a[2] > a[1] && a[1] + a[2] > a[0]) {
      cnt[0] ++;
      sort(a.begin(), a.end());
      if (a[0] * a[0] + a[1] * a[1] > a[2] * a[2])  cnt[1] ++;
      if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) cnt[2] ++;
      if (a[0] * a[0] + a[1] * a[1] < a[2] * a[2])  cnt[3] ++;
    }
  }

  cout << cnt[0];
  cout << " " << cnt[1];
  cout << " " << cnt[2];
  cout << " " << cnt[3];
  cout << endl;
}