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 <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

void sort(int *a, int *b, int *c){
  int tmp;
  if(*a == max(*a, max(*b, *c))){
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }else if(*b == max(*b, *c)){
    tmp = *a, *a = *b, *b = tmp;
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }else{
    tmp = *a, *a = *c, *c = tmp;
    if(*b < *c) tmp = *b, *b = *c, *c = tmp;
  }
}

int judge(int a, int b, int c){ // 1:直角三角形 2:鋭角三角形 3:鈍角三角形
  if(SQ(a) == SQ(b) + SQ(c)) return 1;
  if(SQ(a) < SQ(b) + SQ(c)) return 2;
  if(SQ(a) > SQ(b) + SQ(c)) return 3;
  return 0;
}

int main(){
  int A, B, C;
  ll res[4];
  memset(res, 0, sizeof(res));
  while(cin >> A >> B >> C){
    sort(&A, &B, &C);
    cout << A << " " << B << " " << C << endl;
    if(A >= B + C) break;
    res[0]++;
    res[judge(A, B, C)]++;
  }

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

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>


using namespace std;
typedef long long ll;

#define mod 1000000007
#define INF 2000000000
#define LLINF 4000000000000000000
#define SIZE 100

int main(){
    int a[3],ans1=0,ans2=0,ans3=0;
    
    while(1){
        scanf("%d%d%d",&a[0],&a[1],&a[2]);
        
        sort(a,a+3);
        
        if(a[0]+a[1] <= a[2]){
            printf("%d %d %d %d\n",ans1+ans2+ans3,ans1,ans2,ans3);
            return 0;
        }
        
        if(a[0]*a[0]+a[1]*a[1] == a[2]*a[2]){
            ans1++;
        
        }else if(a[0]*a[0]+a[1]*a[1] > a[2]*a[2]){
            ans2++;
        
        }else if(a[0]*a[0]+a[1]*a[1] < a[2]*a[2]){
            ans3++;
        }
        
        
    }
    
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define MOD (1000000007)
#define INF (1e9)
#define INFL (1e18)

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
template<class T>using arr=vector<vector<T>>;
template<class T>void pr(T x){cout << x << endl;}
template<class T>void prvec(vector<T>& a){rep(i, a.size()-1){cout << a[i] << " ";} cout << a[a.size()-1] << endl;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int type[3]={};
bool isTriangle(int a, int b, int c){
    if(a+b <= c || b+c <= a || c+a <= b) return false;
    return true;
}

void types(int a, int b, int c){
    a *= a;
    b *= b;
    c *= c;
    if(a+b == c || b+c == a || c+a == b) type[0]++;
    else if(a+b < c || b+c < a || c+a < b) type[2]++;
    else type[1]++;
}

int main()
{
    int a, b, c;
    
    while(cin >> a >> b >>c){
        if(!isTriangle(a,b,c)) break;
        types(a,b,c);
    }
    printf("%d %d %d %d\n", type[0] + type[1] + type[2], type[0], type[1], type[2]);
    return 0;}

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

int main() {
    int t1 = 0,
        t2 = 0,
        t3 = 0;
    vector<int> v(3);
    
    int i = 0;
    for ( ; ; i++) {
        cin >> v.at(0) >> v.at(1) >> v.at(2);
        sort(v.begin(), v.end());
        
        if ((v.at(0) + v.at(1)) <= v.at(2)) break;
        if (v.at(0) >= (v.at(1) + v.at(2))) break;
        if ((v.at(0) + v.at(2)) <= v.at(1)) break;
        
        if ((v.at(2) * v.at(2)) == (v.at(0) * v.at(0) + v.at(1) * v.at(1))) {
            t1++;
        } else if ((v.at(2) * v.at(2)) < (v.at(0) * v.at(0) + v.at(1) * v.at(1))) {
            t2++;
        } else if ((v.at(2) * v.at(2)) > (v.at(0) * v.at(0) + v.at(1) * v.at(1))) {
            t3++;
        }
    }
    //cout << v.at(0) << v.at(1) << v.at(2);
    cout << i << ' ';
    cout << t1 << ' ';
    cout << t2 << ' ';
  	cout << t3 << endl;
}

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;
            b=c;
            c=b;
        }
        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\n",count,right,acute,obtuse);
    return 0;
}

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

int main(){
    
    int a,b,c;
    int s,c,e,d;
    s = c = e = d = 0;
    
    while(1){
        cin >> a >> b >> c;
        if(a==0) break;
        s++;
        a=a*a;
        b=b*b;
        c=c*c;
        int hantei;
        if(a>b){
            if(a>c){
                hantei=a-b-c;
            }else{
                hantei=c-a-b;
            }
        }else{
            if(b>c){
                hantei=b-a-c;
            }else{
                hantei=c-a-b;
            }
        }
        if(hantei>0){
            d++;
        }else if(hantei<0){
            e++;
        }else{
            c++;
        }
    }
    
    cout << s << " " << c << " " << e << " " << d << endl;
    
    return 0;
}