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

int solve(int a,int b,int c){
  if(b*b+a*a==c*c) return 1;
  else if(b*b+a*a>c*c) return 2;
  else if(b*b+a*a<c*c) return 3;
  return 0;
}

int main(){
  int a[3];
  int ans,ans1,ans2,ans3;
  bool flag=0;
  
  ans=ans1=ans2=ans3=0;
 
  while(cin>>a[0]>>a[1]>>a[2]){
    sort(a,a+3);
    // cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl;
    if((a[0]+a[1])>a[2]&&(a[1]+a[2])>a[0]&&(a[0]+a[2])>a[1]&&flag==0){
      ans++;
      if(solve(a[0],a[1],a[2])==1) ans1++;
      else if(solve(a[0],a[1],a[2])==2) ans2++;
      else if(solve(a[0],a[1],a[2])==3) ans3++;
    }else flag=1 ;
  }
  cout<<ans<<" "<<ans1<<" "<<ans2<<" "<<ans3<<endl;
  return 0;
}

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

int main() {
    int x, y, z;
    int count = 0;
    int a = 0, b = 0, c = 0;
    while (cin >> x >> y >> z) {
        int l = max(x, max(y, z));
        if (l >= (x + y + z - l)) break;
        vector<int> v = {x, y, z};
        sort(v.begin(), v.end());
        int rhs = v[0] * v[0] + v[1] * v[1];
        int lhs = v[2] * v[2];
        if (lhs == rhs) {
            a++;
        } else if (lhs < rhs) {
            b++;
        } else {
            c++;
        }
        count++;
    }
    cout << count << " " << a << " " << b << " " << c << endl;

    return 0;
}

C++: #include<cstdio>
#include<algorithm>
using namespace std;
bool fin = false;
int cnt1,cnt2,cnt3;//鋭角 直角 鈍角
int num[3];
void solve(){
  sort(num,num+3);
  if(fin || num[0] + num[1] <= num[2]){
    fin = true;
    return;
  }
  if(num[0] * num[0] + num[1] * num[1] < num[2] * num[2])
    cnt3++;
  else if(num[0] * num[0] + num[1] * num[1] == num[2] * num[2])
    cnt2++;
  else
    cnt1++;
}
int main(){
  cnt1 = cnt2 = cnt3 = 0;
  while(scanf("%d",&num[0]) != EOF){
    scanf("%d %d",&num[1],&num[2]);
    solve();
  }
  printf("%d %d %d %d\n",cnt1+cnt2+cnt3,cnt2,cnt1,cnt3);
}

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

int main() {
  vector<int> cnt(3,0);
  while(true) {
    vector<int> v(3);
    cin >> v[0] >> v[1] >> v[2];
    sort(v.begin(),v.end());
    if(v[2] >= v[0]+v[1])
       break;
    if(v[2]*v[2] > v[0]*v[0] + v[1]*v[1])
      cnt[2]++;
    if(v[2]*v[2] == v[0]*v[0] + v[1]*v[1])
      cnt[1]++;
    else
      cnt[0]++;
  }
  cout << cnt[0] + cnt[1] + cnt[2] << cnt[0] << " " << cnt[1] << " " << cnt[2] << endl;
}

C++: #include<iostream>
using namespace std;
int main(){
	int i,x,y ,z,a,b,c,ch=0,ei=0,d=0;

	for(i=0;i<100;i++)
	{
		cin>>x>>y>>z;

		if(x>=y && y>=z) 
		{
			a=x;
			b=y;
			c=z;
		}
		else if(y>=x  && x>=z)
		{
			a=y;
			b=x;
			c=z;
		}
		if (z>=x && x>=y)
		{
			a=z;
			b=y;
			c=x;
		}
		if(b+c<=a)
		{
			break;
		}               
		if (a*a<b*b+c*c)
		{
			ei+=1;
		}
		else if (a*a>b*b+c*c)
		{
			ch+=1;
		}
		else
		{
			d+=1;
		}
	}

	cout<<ch+d+ei<<" "<<ch<<" "<<ei<<" "<<d<<endl;
	return 0;
}

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

int main() {
    int x,y,z;
    int san,don,cho,ei;
    for(int i=0;;i++){
        cin >> x >> y >> z;
        int a = max(max(x,y),z),b,c;
        if(a == x) b=y,c=z;
        else if(a == y) b=z,c=x;
        else if(a == z) b=x,c=y;

        if(a >= b+c) break;

        else if(a*a > b*b + c*c){
            san++;
            don++;
        }
        else if(a*a == b*b + c*c){
            san++;
            cho++;
        }
        else if(a*a < b*b + c*c){
            san++;
            ei++;
        }
    }

    cout << san << ' ' << cho << ' ' << ei << ' ' << don << endl;
    return 0;
}

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

C++: #include<stdio.h>
int main()
{
    int d=0,t=0,e=0,a,b,c,A,B,C,h;
    while(1){
        scanf("%d%d%d",&a,&b,&c);
        if(a>b&&a>c){
            C=a;
            A=b;
            B=c;
        }else if(b>a&&b>c){
            B=c;
            C=b;
            A=a;
        }else{
            A=a;
            B=b;
            C=c;
        }
        if(A+B<=C){
            printf("%d %d %d %d\n",d+t+e,t,e,d);
            break;
        }
        h=A*A+B*B-C*C;
        if(h>0){
            e++;
        }else if(h<0){
            d++;
        }else{
            t++;
        }
    }
    return 0;
}

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

int main() {
  vector<int> cnt(3,0);
  while(true) {
    vector<int> v(3);
    cin >> v[0] >> v[1] >> v[2];
    sort(v.begin(),v.end());
    if(v[2] >= v[0]+v[1])
       break;
    if(v[2]*v[2] > v[0]*v[0] + v[1]*v[1])
      cnt[2]++;
    else if(v[2]*v[2] == v[0]*v[0] + v[1]*v[1])
      cnt[1]++;
    else
      cnt[0]++;
  }
  cout << cnt[0] + cnt[1] + cnt[2] << " " << cnt[1] << " " << cnt[0] << " " << cnt[2] << endl;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define first F
#define second S

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  vi l(3);
  vi n(4,0);
  while(scanf("%d %d %d",&l[0],&l[1],&l[2])!=EOF){
    sort(all(l));
    if(l[0]+l[1]>l[2])n[0]++;
    else continue;
    double cosine=double(l[0]*l[0]+l[1]*l[1]-l[2]*l[2])/(2*l[0]*l[1]);
    if(fabs(cosine)<EPS)n[1]++;
    else if(cosine>0)n[2]++;
    else if(cosine<0)n[3]++;
  }
  printf("%d %d %d %d\n",n[0],n[1],n[2],n[3]);
}