Go: package main
// 三角形の形は辺の長さで決まる． 順番に３つの正整数が与えられたとき， 辺の長さがそれらの値と一致する三角形が存在するかどうかを調べ,
//  存在するなら鋭角三角形，直角三角形，鈍角三角形のいずれかを判定し， 次の入力へ進む． 三角形が存在しないとき， それまでに入力された，
// 三角形，直角三角形，鋭角三角形，鈍角三角形の 個数を空白で区切って出力し， それ以降の入力は無視して終了する
// 入力の中には必ず三角形が存在しないようなものがある と仮定してよい. 入力の行数は判らないが各行には３つの正整数が空白で区切って書かれている．
//  ただし，各整数は100 以下とする.

// return
// 三角形 直角三角形　鈍角三角形 鈍角三角形
import (
	"os"
	"fmt"
	"bufio"
)


var sc = bufio.NewScanner(os.Stdin)

func max(a, b, c int) (int, int, int) {
	if a > b {
		if b > c {
			return a, b, c
		} else {
			return a, c, b
		}
	} else {
		if b > c {
			return b, a, c
		} else {
			return c, b, a
		}
	}
}

func find_trianges(a, b, c int) string {
	a, b, c = max(a, b, c)
	r := b*b + c*c
	if a*a > r {
		return "obtuse_triangle"
	} else if a*a < r {
		return "sharped_triangle"
	} else {
		return "right_triangle"
	}
}

func main() {
	s := bufio.NewScanner(os.Stdin)
	var t, r_t, s_t, o_t int = 0, 0, 0, 0
	for s.Scan() {
		var a, b, c int
		fmt.Sscan(s.Text(), &a, &b, &c)
			a, b, c = max(a, b, c)
			if (a < b + c) {
				r := find_trianges(a, b, c)
				switch r {
				case "right_triangle":
					r_t++
				case "sharped_triangle":
					s_t++
				case "obtuse_triangle":
					o_t++
				}
				t++
			}	else {
				break
			}
			
	}
	fmt.Println(t, r_t, s_t, o_t)
}

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


}