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 <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main() {
	vector<int> v(3);
	int a = 0, b = 0, c = 0, d = 0;

	while(cin >> v[0] >> v[1] >> v[2]) {
		sort(v.begin(), v.end());

		int d = v[0] * v[0];
		int e = v[1] * v[1];
		int f = v[2] * v[2];

		if(v[0] + v[1] <= v[2]) break;

		if(f < d + e) a++;
		else if(f == d + e) b++;
		else c++;
	}

	cout << a + b + c << " " << b << " " << a << " " << c << endl;
	return 0;
}

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

using namespace std;

int main(int argc, char const *argv[]) {
    int edge[3];
    int tri[3]={0};//0:right, 1:acute, 2:obtuse
    int total=0;

    while(1){
        for(int i=0;i<3;i++)
            cin >> edge[i];
        sort(edge,edge+3);
        if(edge[2] < edge[0] + edge[1]){
            total++;
            if(pow(edge[2],2) == pow(edge[0],2) + pow(edge[1],2)){
                tri[0]++;
            }else if(pow(edge[2],2) < pow(edge[0],2) + pow(edge[1],2)){
                tri[1]++;
            }else{
                tri[2]++;
            }
        }else{
            break;
        }
    }
    printf("%d %d %d %d\n",total,tri[0],tri[1],tri[2]);
    return 0;
}

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

int main(){
	int in[3]={};
	int ary[4]={};
	while(true){
		for(int i=0;i<3;i++) cin>>in[i];
		sort(in,in+3);
		if(in[0]+in[1]<=in[2]) break;
		else if(in[0]*in[0]+in[1]*in[1]<in[2]*in[2]) ary[3]++;
		else if(in[0]*in[0]+in[1]*in[1]==in[2]*in[2]) ary[1]++;
		else ary[2]++;
		ary[0]++;
	}
	cout<<ary[0]<<" "<<ary[1]<<" "<<ary[2]<<" "<<ary[3]<<endl;
	return 0;
}

C++: #include<iostream>
#include<algorithm>
 
using namespace std;
 
int main() {
    int ans[3] = {};
    while (1) {
        int a[3];
        cin>>a[0]>>a[1]>>a[2];
        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])ans[0]++;
        if(a[0]*a[0]+a[1]*a[1]>a[2]*a[2])ans[1]++;
        if(a[0]*a[0]+a[1]*a[1]<a[2]*a[2])ans[2]++;
    }
    cout<<ans[0]+ans[1]+ans[2];
    for(int i=0; i<3; i++) cout<<" "<<ans[i];
    cout<<endl;
}

C++: #include<iostream>
#include<cmath>
#include<algorithm>
 
using namespace std;
 
int main(void){
 
  int a,b,c,res[4]={};
 
  while(cin >> a >> b >> c){
    
    if(a+b<=c || a+c<=b || b+c<=a){

      for(int i=0;i<4;i++){
	cout << res[i];
	if(i<3)cout <<" ";
      }
      cout <<endl;
      break;
    }
    
    res[0]++;
    if(a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a)res[1]++;
    else if(a*a+b*b>=c*c && a*a+c*c>=b*b && b*b+c*c>=a*a)res[2]++;
    else res[3]++;
  } 
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <string>
#include <queue>
#include <list>
#include <stack>

using namespace std;

/* constant */

const int INF = 1 << 30;
const int mod = 1000000007;

/* typedef */

typedef long long ll;

/* global variables */
vector<int> v(4, 0);

/* function */
bool judge(int x, int y, int z);

/* main */
int main() {

    while (1) {
        int a, b, c; cin >> a >> b >> c;
        if (a < b) swap(a, b);
        if (b < c) swap(b, c);
        if (a < b) swap(a, b);

        if (!judge(a, b, c)) {
            cout << v[0] << ' ' << v[1] << ' ' << v[2] << ' ' << v[3] << '\n';
            return 0;
        }
    }

}

bool judge(int x, int y, int z) {

    bool triangle = true;

    if (x >= y + z or y >= x + z or z >= x + y) {
        triangle = false;
    }
    else {
        v[0]++;
        int A = y * y + z * z - x * x;
        if (A == 0) {
            v[1]++;
        }
        else if (A > 0) {
            v[2]++;
        }
        else {
            v[3]++;
        }
    }

    return triangle;
}

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

bool exist(int a,int b,int c){
    bool flag=false;
    if(a>0,b>0&&c>0&&a+b>c&&a+c>b&&c+b>a)flag=true;
    return flag;
}
int type_check(int a,int b,int c){
    if(a*a+b*b==c*c)return 1;
    else if(a*a<b*b+c*c)return 0;
    else if(a*a>b*b+c*c)return 2;
    else return 3;
}

int main(){
    int a,b,c,c1=0,c2=0,c3=0,c4=0;
    while(true){
        cin >> a>>b>>c;
        if(!exist(a,b,c))break;
        switch(type_check(a,b,c)){
            case 0: c1++; break;
            case 1: c2++; break;
            case 2: c3++; break;
        }
        c4++;
    }
    cout <<c4<<" "<<c2<<" "<<c1<<" "<<c3<<" " <<endl;
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int a[3],type[4];
    for(int i=0;i<4;i++)type[i]=0;
    while(true){
        bool f=false;
        for(int i=0;i<3;i++)cin>>a[i];
        for(int i=0;i<3;i++){
            if(a[i]>=a[(i+1)%3]+a[(i+2)%3])f=true;
        }
        if(f)break;
        type[0]++;
        sort(a,a+3);
        if(a[2]*a[2]>a[1]*a[1]+a[0]*a[0])type[3]++;
        else if(a[2]*a[2]==a[1]*a[1]+a[0]*a[0])type[1]++;
        else type[2]++;

    }
    while(cin>>a[0]);
    for(int i=0;i<4;i++){
        if(i==0)cout<<type[0];
        else cout<<" "<<type[i];
    }
    cout<<endl;
    return 0;
}
/*3 4 5
2 1 2
6 3 4
1 1 1
1 2 3*/

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

int main() {
    int all = 0, right_angle = 0, acute = 0, obtuse = 0;
    while (true) {
        int a, b, c; cin >> a >> b >> c;

        if ( !(a + b > c && b + c > a && c + a > b) ) {
            cout << all         << " "
                 << right_angle << " "
                 << acute       << " "
                 << obtuse      << endl;
            break;
        }

        all++;
        if (pow(a,2) + pow(b,2) == pow(c,2) ||
            pow(b,2) + pow(c,2) == pow(a,2) ||
            pow(c,2) + pow(a,2) == pow(b,2)) right_angle++;
        else if (pow(a,2) + pow(b,2) > pow(c,2) &&
                 pow(b,2) + pow(c,2) > pow(a,2) &&
                 pow(c,2) + pow(a,2) > pow(b,2)) acute++;
        else obtuse++;
    }
}