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++: //19
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  int t[4]={};
  for(;;){
    int e[3];
    cin>>e[0]>>e[1]>>e[2];
    sort(e,e+3);
    if(e[2]>=e[0]+e[1])break;
    t[0]++;
    int c=e[2]*e[2]-e[1]*e[1]-e[0]*e[0];
    if(c>0){
      t[1]++;
    }else if(c==0){
      t[2]++;
    }else{
      t[3]++;
    }
  }
  cout<<t[0]<<' '<<t[2]<<' '<<t[3]<<' '<<t[1]<<endl;
  return 0;
}

C++: #include<cstdio>
int main(void){
    
    int a=0,b=0,c=0;
    int change=0;
    int right=0,obtuse=0,acute=0;
    int value=0,check=0,count=0;
    int flag=true;
    while(flag){
        count++;
        scanf("%d%d%d",&a,&b,&c);
        if(c<a){
            change=a;
            a=c;
            c=a;
        }
        if(c<b){
            change=b;
            a=b;
            b=a;
        }
        check=a+b-c;
        value=a*a+(b*b-c*c);
        if(check<=0){
            break;
        }
        if(value==0){
            right++;
        }
        else if(value<0){
            obtuse++;
        }
        else{
            acute++;
        }
    }
    printf("%d %d %d %d",count,right,obtuse,acute);
    return 0;
}

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

bool ignore;
int right;
int acute;
int obtuse;

int main() {
    while (1) {
        int es[3];
        int p, q;

        if (scanf("%d %d %d", &es[0], &es[1], &es[2]) == EOF) return 0;
        if (ignore) continue;

        sort(es, es+3);
        if (es[0]+es[1] <= es[2]) {
            ignore = true;
            printf("%d %d %d %d\n", right+acute+obtuse, right, acute, obtuse);
            continue;
        }

        p = es[0]*es[0] + es[1]*es[1];
        q = es[2]*es[2];
        if (p == q) right++;
        else if (p > q) acute++;
        else obtuse++;
    }
}

C++: #include <iostream>
#include <algorithm>
#include <ios>     // std::left, std::right
#include <iomanip> // std::setw(int), std::setfill(char)
#include <string>
#include <cmath>
#include <vector>
using namespace std;

int main(int argc, char const *argv[]) {
    int tri[100][3];
    int cnt[4] = {0};

    while(true){
        vector<int> point(3);
        cin >> point[0] >> point[1] >> point[2];
        sort(point.begin(), point.end());
        int x = point[0];
        int y = point[1];
        int z = point[2];
        if (x+y <= z) break;
        cnt[0]++;
        if (x*x + y*y == z*z){
            cnt[1]++;
        } else if (x*x + y*y > z*z){
            cnt[2]++;
        } else {
            cnt[3]++;
        }
    }
    for (int i = 0; i < 3; i++){
        cout << cnt[i] << " ";
    }
    cout << cnt[3] << endl;
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),in.end()
#define PI acos(-1)
using namespace std;
int main(){
  int a,b,c;
  int x=0,y=0,z=0,w=0;
  while(cin>>a>>b>>c){
    vector<int>in(3);
    in[0]=a;in[1]=b;in[2]=c;
    sort(all(in));
    if(in[0]+in[1]<=in[2])break;
    x++;    
    if(in[0]*in[0]+in[1]*in[1]==in[2]*in[2])y++;
    if(in[0]*in[0]+in[1]*in[1]>in[2]*in[2])z++;
    if(in[0]*in[0]+in[1]*in[1]<in[2]*in[2])w++;
  }
  cout<<x<<" "<<y<<" "<<z<<" "<<w<<endl;
}

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

using namespace std;

int main() {
	
	int Length[3];
	int Triangle[4] = {};
	bool flag = 0;
	
	while( cin >> Length[0] >> Length[1] >> Length[2]) ) {
	
	sort(Length, Length+3);
	
	if( Length[0] + Length[1] <= Length[2] ) flag = 1;
	if(flag == 1) continue;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) == pow(Length[2], 2) )
	Triangle[1]++;
	
	else if( pow(Length[0], 2) + pow(Length[1], 2) < pow(Length[2], 2) )
	Triangle[2]++;
	
	else
	Triangle[3]++;
	
	}
	Triangle[0] += ( Triangle[1] + Triangle[2] + Triangle[3] );
	cout << Triangle[0] << " " << Triangle[1] << " "
		 << Triangle[2] << " " << Triangle[3] << "\n";
	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] >> [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;
}

C++: #include<bits/stdc++.h>
#include <stdio.h>
#include<iostream.h>
#include<algorithm>
using namespace std;
int main()
{
	int a,b,c,right,obtuse,acute,tri;
	cin >> a,b,c;
	right,obtuse,acute,tri = 0;
	int sides[3] = {a,b,c};
	sort(sides[0],sides[2]);
	while (sides[2]<sides[0]+sides[1])
	{
		if (sides[2]*sides[2] == sides[0]*sides[0]+sides[1]*sides[1])
		{
			tri += 1;
			right += 1;
		}
		else if (sides[2]*sides[2] > sides[0]*sides[0]+sides[1]*sides[1])
		{
			tri += 1;
			obtuse += 1;
		}
		else
		{
			tri += 1;
			acute += 1;
		}
	}
	{
		printf("%d %d %d %d",tri,right,obtuse,acute);
	}	
}

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

constexpr inline int square(int x) {
	return x * x;
}

int main() {
	int edge[3];
	int triangle = 0;
	int right	 = 0;
	int acute	 = 0;
	int obtuse	 = 0;

	while(scanf("%d %d %d", edge, edge + 1, edge + 2) == 3) {
		sort(edge, edge + 3);

		if(edge[0] + edge[1] <= edge[2]) {
			printf("%d %d %d %d\n", triangle, right, acute, obtuse);
			continue;
		}

		++triangle;
		const int a = square(edge[0]) + square(edge[1]);
		const int b = square(edge[2]);

		if(a == b) ++right;
		else if(a > b) ++acute;
		else ++obtuse;
	}

	return EXIT_SUCCESS;
}

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]++;
		
				
	}


}