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

using namespace std;

int main(){
    int e[3];
    int cnt1=0,cnt2=0,cnt3=0,cnt4=0;
    while(cin>>e[0]>>e[1]>>e[2]){
        sort(e,e+3);
        int a=e[0],b=e[1],m=e[2];
        if(m<a+b){
            ++cnt1;
            if(m*m<a*a+b*b) ++cnt3;
            else if(m*m==a*a+b*b) ++cnt2;
            else ++cnt4;
        }
        else break;
    }
    cout<<cnt1<<" "<<cnt2<<" "<<cnt3<<" "<<cnt4<<endl;
    return 0;
}

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

int main()
{
    int sum=0,x=0,y=0,z=0,l[3];

    while(1){
        cin>>l[0]>>l[1]>>l[2];
        sort(l,l+3);

        if(l[2]>l[0]+l[1])break;
        
        sum++;

        int a = l[2]*l[2];
        int b = l[0]*l[0] + l[1]*l[1];

        if(a>b)z++;
        if(a==b)y++;
        if(a<b)x++;

    }

    cout<<sum<<" "<<y<<" "<<x<<" "<<z<<endl;

    return 0;
}

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

int main(){
  int a[3];
  int cnt[4] = {0, 0, 0, 0};
  while (true) {
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a + 3);
    if (a[0] + a[1] > a[2]) {
      cnt[0] ++;
      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] ++;
    } else {
      break;
    }
  }

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

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

int triangle(int a, int b, int c){
  int max;
  if(a<b) max = b;
  else max = a;
  if(max<c) max = c;
  if(max >= a + b + c - max) return 0;
  int sqsum = a*a + b*b + c*c, sqmax = max*max;
  if(sqmax == sqsum - sqmax){
    return 1;
  }else if(sqmax < sqsum - sqmax){
    return 2;
  }
  return 3;
}

int main(){
  int tri[3]={};
  while(1){
    int a, b, c, ans;
    cin>>a>>b>>c;
    ans = triangle(a, b, c);
    if(!ans) break;
    tri[ans-1]++;
  }
  cout<<tri[0]+tri[1]+tri[2]<<" "<<tri[0]<<" "<<tri[1]<<" "<<tri[2]<<endl;
  return 0;
}

C++: #include <stdio.h>
#include <algorithm>

using namespace std;

int main(void)
{
	int node[5];
	int i, j, a = 0, b = 0, c = 0, d = 0, ch = 0;
	
	while (scanf("%d %d %d", &node[0], &node[1], &node[2]) != EOF){
		
		sort(node, node + 3);
		
		if (node[0] + node[1] <= node[2]){
			ch = 1;
		}
		if (ch == 0){
			a++;
		
			if (node[0] * node[0] + node[1] * node[1] == node[2] * node[2]){
				b++;
			}
			else if (node[0] * node[0] + node[1] * node[1] > node[2] * node[2]){
				c++;
			}
			else if (node[0] * node[0] + node[1] * node[1] < node[2] * node[2]){
				d++;
			}
		}
	}
	
	printf("%d %d %d %d\n", a, b, c, d);
	
	return (0);
}

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

int main(){

  int a,b,c,tri=0,ei=0,ty=0,don=0,maxnum;

  while(1){

    cin >> a >> b >> c;

    maxnum = max(a,max(b,c));

    if(maxnum == b){
      b = a;
      a = maxnum;
    }
    else if(maxnum == c){
      c = a;
      a = maxnum;
    }

    if(a < (b + c) ){
      tri++;
      if(a*a > b*b + c*c){
        don++;
      }
      else if(a*a == b*b + c*c){
        ty++;
      }
      else{
        ei++;
      }
    }
    else{
      cout << tri << " " << ty << " " << ei << " " << don << endl;
      break;
    }
  }

  return 0;
}

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

using ll = long long;
using namespace std;

int main() {
    int a[3];
    int x = 0, y = 0, z = 0;
    while (true){
        for (int &i : a) cin >> i;
        sort(a, a+3);
        if (a[0]+ a[1] <= a[2]) break;
        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++;
        else y++;
    }
    printf("%d %d %d %d\n",x+y+z, x, y, z);
    return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
  int count_total = 0; // 合計
  int count_1 = 0; // 直角三角形
  int count_2 = 0; // 鋭角
  int count_3 = 0; // 鈍角
  while(true) {
    int long_side = 0;
    int short_side1 = 0;
    int short_side2 = 0;
    int a, b, c = 0;
    cin >> a >> b >> c;
    if (!(abs(b-c) < a && a < b + c)) {
      cout << "-----" << endl;
      cout << count_total << " " << count_1 << " " << count_2 << " " << count_3 << endl;
      return 0;
    }
    count_total++;
    int max_side = a;
    if (b > a && b > c) {
      // bが一番長い
      long_side = b;
      short_side1 = a;
      short_side2 = c;
    } else if (c > a && c > b) {
      // cが一番長い
      long_side = c;
      short_side1 = a;
      short_side2 = b;
    } else {
      // aが一番長い
      long_side = a;
      short_side1 = b;
      short_side2 = c;
    }
    int d1 = long_side * long_side;
    int d2 = short_side1 * short_side1 + short_side2 * short_side2;
    // 鈍角
    if (d1 > d2) {
      count_3++;
    } else if (d1 == d2) {
      // 直角
      count_1++;
    } else {
      // 鋭角
      count_2++;
    }
  }

}

C++: #include<cstdio>
int a,b,c;
int re[4]={-1};
void st(int* p,int* q){
int r;
if(*p<*q){
r=*p;*p=*q;*q=r;
}
return;
}
int main(void){
while(1){
re[0]++;
scanf("%d%d%d",&a,&b,&c);
st(&a,&b);st(&a,&c);st(&b,&c);
if(a>=b+c)break;
if(a*a>b*b+c*c)re[3]++;
else if(a*a<b*b+c*c)re[2]++;
else re[1]++;
}
printf("%d",re[0]);
for(a=1;a<4;a++){
printf(" %d",re[a]);
}
printf("\n");
return 0;
}

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

inline int sq(const int x) { return x * x; };

int main() {
    vector<int> s(3, 0);
    while(true) {
        vector<int> in(3);
        for(int i = 0; i < 3; i++) cin >> in[i];
        sort(in.begin(), in.end());
        if(in[0] + in[1] <= in[2]) break;
        int left = sq(in[2]);
        int right = sq(in[0]) + sq(in[1]);
        if(left == right) s[1]++;
        else if(left < right) s[0]++;
        else s[2]++;
    }
    cout << accumulate(s.begin(), s.end(), 0) << ' ' << s[1] << ' ' << s[0] << ' ' << s[2] << endl;
}