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 <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	ll sankaku=0ll,eikaku=0ll,chokkaku=0ll,donkaku=0ll;
	while(1)
	{
		int a,b,c;
		cin >> a >> b >> c;
		if(a+b>c&&a+c>b&&b+c>a)
		{
			sankaku++;
			if(a*a+b*b==c*c||b*b+c*c==a*a||c*c+a*a==b*b)chokkaku++;
			else if(a*a+b*b<c*c||b*b+c*c<a*a||c*c+a*a<b*b)donkaku++;
			else eikaku++;
		}
		else
		{
			cout <<sankaku<<' '<<chokkaku<<' '<<eikaku<<' '<<donkaku<<endl;
			break;
		}
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;

int main()
{
	vector<int> r(3);
	int tcounter = 0;
	int ecounter = 0;
	int dcounter = 0;
	for (int i = 0; i < 100000000; i++) {
		cin >> r[0] >> r[1] >> r[2];
		sort(r.begin(), r.end());
		if (r[0] + r[1] > r[2]) {
			if (r[0] * r[0] + r[1] * r[1] > r[2] * r[2]) ecounter++;
			else if (r[0] * r[0] + r[1] * r[1] < r[2] * r[2]) dcounter++;
			else tcounter++;
		}
		else {
			cout << i << " " << tcounter << " " << ecounter << " " << dcounter << endl;
			break;
		}
	}
}

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

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int h[3],ans[4]={0};
	bool check=true;
	while(cin>>h[0]>>h[1]>>h[2]){
		sort(h,h+3);
		if(h[2]>=h[1]+h[0])
			check=false;
		if(check==true){
			ans[0]++;
			if(h[0]*h[0]+h[1]*h[1]>h[2]*h[2])
				ans[2]++;
			if(h[0]*h[0]+h[1]*h[1]==h[2]*h[2])
				ans[1]++;
			if(h[0]*h[0]+h[1]*h[1]<h[2]*h[2])
				ans[3]++;
		}
	}
	for(int i=0;i<3;i++)
		cout<<ans[i]<<" ";
	cout<<ans[3]<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int cnt[4]={};
  int a[3];
  while(cin>>a[0]>>a[1]>>a[2]){
    sort(a,a+3);
    if(a[2]>=a[1]+a[0])break;
    for(int i=0;i<3;i++)a[i]*=a[i];
    cnt[0]++;
    if(a[2]==a[1]+a[0])cnt[1]++;
    else if(a[2]<a[1]+a[0])cnt[2]++;
    else cnt[3]++;
  }
  cout<<cnt[0]<<" "<<cnt[1]<<" "<<cnt[2]<<" "<<cnt[3]<<endl;
  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; // 鈍角
  for (int l = 0; l < 100; l++) {
    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 << 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;
    }
    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<iostream>
#include<cmath>
#include<algorithm>

using namespace std;

int main() {
	
	int Length[3];
	
	while(scanf("%d %d %d", &Length[0], &Length[1], &Length[2]) != EOF) {

	int Trinagle[4] = {};	
	sort(Length, Length+3);
	
	if( Length[0] + Length[1] <= Length[2] ) {
		
        cout << Trinagle[0] << " " << Trinagle[1] << " "
		 	<< Trinagle[2] << " " << Trinagle[3] << "\n";
		 	return 0;
        }
	
	Trinagle[0]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) == pow(Length[2], 2) )
	Trinagle[1]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) < pow(Length[2], 2) )
	Trinagle[2]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) > pow(Length[2], 2) )
	Trinagle[3]++;
	
	}
}

C++: #include"iostream"
#include"algorithm"
using namespace std;

int main()
{
  int a,b,c;
  int count=0;
  int acute=0,right=0,obtuse=0;
  while(cin>>a>>b>>c){
    if(b<c){
      swap(b,c);
    }
    if(a<b){
      swap(a,b);
    }
    if(a>=b+c){
      cout<<count<<" "<<right<<" "<<acute<<" "<<obtuse<<endl;
      break;
    }
    if(a*a<b*b+c*c){
      acute++;
    }else if(a*a==b*b+c*c){
      right++;
    }else{
      obtuse++;
    }
    count++;
  }
  return 0;
}

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

int main(){
	int a[3];
	int w;
	int count[3]={0};
	while(cin>>a[0]>>a[1]>>a[2]){
	
		sort(a,a+3);
		if(a[0]+a[1]<=a[2]){
			cout<<count[0]+count[1]+count[2]<<count[0]<<count[1]<<count[2]<<endl;
			return 0;
		}
		if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])count[0]++;
		if(a[0]*a[0]+a[1]*a[1]>a[2]*a[2])count[1]++;
		if(a[0]*a[0]+a[1]*a[1]<a[2]*a[2])count[2]++;
		
				
	}


}

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

using namespace std;

int main()
{
	int a, b, c;
	int na, nb, nc, nd;
	
	na = nb = nc = nd = 0;
	while (1){
		scanf("%d %d %d", &a, &b, &c);
		if (a < b) swap(a, b); if (a < c) swap(a, c);
		if (a >= b + c) break;
		
		na++;
		if (b * b + c * c == a * a) nc++;
		else if (b * b + c * c < a * a) nd++;
		else nb++;
	}
	printf("%d %d %d %d\n", na, nb, nc, nd);
	
	return (0);
}