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>
using namespace std;
int main(){
    int a,b,c,l=0,m=0,n=0,o=0;
    while(1){
         cin>>a>>b>>c;
         if(a+b>c&&b+c>a&&a+c>b){
           l+=1;
           if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a){
             m+=1;
           }
           int j=0;
           if(j<a){
           j+=a;
           }
           if(j<b){
           j+=b;
           }
           if(j<c){
           j+=c;
           }
           if(j==a){
             if(a*a<b*b+c*c){
               n+=1;
             }
             if(a*a>b*b+c*c){
               o+=1;
             }
           }
           else if(j==b){
             if(b*b<a*a+c*c){
               n+=1;
             }
             if(b*b>a*a+c*c){
               o+=1;
             }
           }
           else{
                  if(c*c<b*b+a*a){
                    n+=1;
                  }
                  if(c*c>b*b+a*a){
                    o+=1;
                  }
           }
         }
         else{break;}
     }
     cout<<l<<" "<<m<<" "<<n<<" "<<o<<endl;
     return 0;
}

C++: #include <iostream>
using namespace std;
int max(int a,int b,int c){
	if(a>b&&a>c)return a;
	else if(b>a&&b>c)return b;
	else return c;
}

int main() {
	int a,b,c,wa,WA;
	int p=0,q=0,r=0,s=0;
	for(int x=p;x==x;p++){
		a=0;
		b=0;
		c=0;
		cin>>a>>b>>c;
		wa=a+b+c;
		WA=a*a+b*b+c*c;
		if(2*max(a,b,c)>=wa)break;
		else if(2*max(a,b,c)*max(a,b,c)==WA)q++;
		else if(2*max(a,b,c)*max(a,b,c)<WA)r++;
		else s++;
		}
		cout<<p<<' '<<q<<' '<<r<<' '<<s<<'\n';
	return 0;
}

C++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-8;
  
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};

int main(){
  int edges[4];

  int total_triangles = 0;

  int right_angle_num = 0;
  int acute_angle_num = 0;
  int obtuse_angle_num = 0;

  while(~scanf("%d %d %d",edges+0,edges+1,edges+2)){
    sort(edges,edges+3);
    if(edges[2] >= edges[0] + edges[1]){
      printf("%d %d %d %d\n",
             total_triangles,
             right_angle_num,
             acute_angle_num,
             obtuse_angle_num);
      break;
    }

    if(edges[2] * edges[2] == edges[0] * edges[0] + edges[1] * edges[1]){
      right_angle_num++;
    }
    else if(edges[2] * edges[2] < edges[0] * edges[0] + edges[1] * edges[1]){
      acute_angle_num++;
    }
    else if(edges[2] * edges[2] > edges[0] * edges[0] + edges[1] * edges[1]){
      obtuse_angle_num++;
    }
    
    total_triangles++;
  }
}

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

int main(){
  int a[3];

  int t,l,v,g;
  t = l = v = g = 0;
  while(cin >> a[0] >> a[1] >> a[2]){
    sort(a,a+3);
    if(a[0]+a[1]<=a[2]){
      cout << t << " " << v << " " << l << " " << g << endl;
      return 0;
    }else{
      t++;
      int s = a[0]*a[0]+a[1]*a[1]-a[2]*a[2];
      if(s<0)g++;
      else if(s==0)v++;
      else l++;
    }
  }
}

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 <iostream>
#include <algorithm>
#include <math.h>
using namespace std;

int main(){
  double a,b,c;
  int cnt[4];
  fill(cnt,cnt+4,0);
  while(cin >> a >> b >> c){
    double array[3];
    int sum = a + b + c;
    int Max = max(a,max(b,c));
    int remain = sum - Max;

    if(Max >= remain){
      break;
    }

    array[0] = a;
    array[1] = b;
    array[2] = c;
    sort(array,array+3);

    double Max_angle = 0;
    do{
      double tmp = (array[0]*array[0]+array[2]*array[2]-array[1]*array[1])/
	(2*array[0]*array[2]);

      Max_angle = max(Max_angle,acos(tmp));
    }while(next_permutation(array,array+3));

    cnt[0]++;

    if(Max_angle > M_PI / 2.0) cnt[3]++;
    else if(Max_angle < M_PI / 2.0) cnt[2]++;
    else cnt[1]++;

  }
  for(int i=0; i<4; i++){
    if(i == 0) cout << cnt[i];
    else cout << " " << cnt[i];
  }
  cout << endl;
  
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c,san=0,tyo=0,don=0,ei=0;
	while(1){
    cin>>a>>b>>c;
	if(a<b)swap(a,b);
	if(a<c)swap(a,c);
	if(a<c+b&&b<a+c&&c<a+b)san=san+1;
	else break;
	if(a*a==b*b+c*c)tyo=tyo+1;
	if(a*a>b*b+c*c)don=don+1;
	if(a*a<b*b+c*c)ei=ei+1;
	}
	cout<<san<<" "<<tyo<<" "<<ei<<" "<<don<<endl;
	return 0;
}

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

using namespace std;

int main() {
    int x,y,z,a,b,c,powa,powb,powc;
    int sankaku = 0;
    int eikaku = 0;
    int chokkaku = 0;
    int donkaku = 0;
    while(true){
        cin >> x >> y >> z;
        
        a = x;
        b = y;
        c = z;

        if(a < y){
            a = y;
            b = x;
            c = z;
        }
        if(a < z){
            a = z;
            b = y;
            c = x;
        }

        if(a >= b + c){
            break;
        } else {
            sankaku++;
            powa = a*a;
            powb = b*b;
            powc = c*c;
       
            if(powa < powb + powc){
                eikaku++;
            } else if(powa > powb + powc) {
                donkaku++;
            } else {
                chokkaku++;
            }
        }
        
    }

    cout << sankaku << " " << chokkaku << " " << eikaku << " " << donkaku << endl;
    return 0;

}