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 a > c {
			return b, a, c
		} else {
			return b, c, 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":
					r_t++
				}
				t++
			}	else {
				break
			}
			
	}
	fmt.Println(t, r_t, s_t, o_t)
}

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

int san = 0;
int a[3];
int inu = 0;
int saru = 0;
int kiji = 0;

int main(){
	while (true){
		for (int i = 0; i < 3; i++){
			cin >> a[i];
		}
		sort(a, a + 3);
		if (a[3] * a[3] < a[2] * a[2] + a[1] * a[1] && a[3] < a[1] + a[2]){
			san = san + 1;
			saru = saru + 1;
		}if (a[3] * a[3] == a[2] * a[2] + a[1] * a[1] && a[3] < a[1] + a[2]){
			san = san + 1;
			inu = inu + 1;
		}if (a[3] * a[3] > a[2] * a[2] + a[1] * a[1] && a[3] < a[1] + a[2]){
			san = san + 1;
			kiji = kiji + 1;
		}if (a[3] >= a[1] + a[2]){
			break;
		}
	}
	cout << san << " " << inu << " " << saru << " " << kiji << endl;
}

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

using namespace std;

int main(){
    int e[3];
    int cnt1=0,cnt2=0,cnt3=0,cnt4=0;
    while(cin>>e[0]>>e[1]>>e[2]){
        sort(e,e+3);
        int a=e[0],b=e[1],m=e[2];
        if(m<a+b){
            ++cnt1;
            if(m*m<a*a+b*b) ++cnt3;
            else if(m*m==a*a+b*b) ++cnt2;
            else ++cnt4;
        }
        else break;
    }
    cout<<cnt1<<" "<<cnt2<<" "<<cnt3<<" "<<cnt4<<endl;
    return 0;
}

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

int main()
{
    int sum=0,x=0,y=0,z=0,l[3];

    while(1){
        cin>>l[0]>>l[1]>>l[2];
        sort(l,l+3);

        if(l[2]>l[0]+l[1])break;
        
        sum++;

        int a = l[2]*l[2];
        int b = l[0]*l[0] + l[1]*l[1];

        if(a>b)z++;
        if(a==b)y++;
        if(a<b)x++;

    }

    cout<<sum<<" "<<y<<" "<<x<<" "<<z<<endl;

    return 0;
}

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

int main(){
  int a[3];
  int cnt[4] = {0, 0, 0, 0};
  while (true) {
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a + 3);
    if (a[0] + a[1] > a[2]) {
      cnt[0] ++;
      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] ++;
    } else {
      break;
    }
  }

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

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

int triangle(int a, int b, int c){
  int max;
  if(a<b) max = b;
  else max = a;
  if(max<c) max = c;
  if(max >= a + b + c - max) return 0;
  int sqsum = a*a + b*b + c*c, sqmax = max*max;
  if(sqmax == sqsum - sqmax){
    return 1;
  }else if(sqmax < sqsum - sqmax){
    return 2;
  }
  return 3;
}

int main(){
  int tri[3]={};
  while(1){
    int a, b, c, ans;
    cin>>a>>b>>c;
    ans = triangle(a, b, c);
    if(!ans) break;
    tri[ans-1]++;
  }
  cout<<tri[0]+tri[1]+tri[2]<<" "<<tri[0]<<" "<<tri[1]<<" "<<tri[2]<<endl;
  return 0;
}

C++: #include <stdio.h>
#include <algorithm>

using namespace std;

int main(void)
{
	int node[5];
	int i, j, a = 0, b = 0, c = 0, d = 0, ch = 0;
	
	while (scanf("%d %d %d", &node[0], &node[1], &node[2]) != EOF){
		
		sort(node, node + 3);
		
		if (node[0] + node[1] <= node[2]){
			ch = 1;
		}
		if (ch == 0){
			a++;
		
			if (node[0] * node[0] + node[1] * node[1] == node[2] * node[2]){
				b++;
			}
			else if (node[0] * node[0] + node[1] * node[1] > node[2] * node[2]){
				c++;
			}
			else if (node[0] * node[0] + node[1] * node[1] < node[2] * node[2]){
				d++;
			}
		}
	}
	
	printf("%d %d %d %d\n", a, b, c, d);
	
	return (0);
}

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

int main(){

  int a,b,c,tri=0,ei=0,ty=0,don=0,maxnum;

  while(1){

    cin >> a >> b >> c;

    maxnum = max(a,max(b,c));

    if(maxnum == b){
      b = a;
      a = maxnum;
    }
    else if(maxnum == c){
      c = a;
      a = maxnum;
    }

    if(a < (b + c) ){
      tri++;
      if(a*a > b*b + c*c){
        don++;
      }
      else if(a*a == b*b + c*c){
        ty++;
      }
      else{
        ei++;
      }
    }
    else{
      cout << tri << " " << ty << " " << ei << " " << don << endl;
      break;
    }
  }

  return 0;
}

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

using ll = long long;
using namespace std;

int main() {
    int a[3];
    int x = 0, y = 0, z = 0;
    while (true){
        for (int &i : a) cin >> i;
        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]) x++;
        else if (a[0] * a[0] + a[1] * a[1] < a[2] * a[2]) z++;
        else y++;
    }
    printf("%d %d %d %d\n",x+y+z, x, y, z);
    return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
  int count_total = 0; // 合計
  int count_1 = 0; // 直角三角形
  int count_2 = 0; // 鋭角
  int count_3 = 0; // 鈍角
  while(true) {
    int long_side = 0;
    int short_side1 = 0;
    int short_side2 = 0;
    int a, b, c = 0;
    cin >> a >> b >> c;
    if (!(abs(b-c) < a && a < b + c)) {
      cout << "-----" << endl;
      cout << count_total << " " << count_1 << " " << count_2 << " " << count_3 << endl;
      return 0;
    }
    count_total++;
    int max_side = a;
    if (b > a && b > c) {
      // bが一番長い
      long_side = b;
      short_side1 = a;
      short_side2 = c;
    } else if (c > a && c > b) {
      // cが一番長い
      long_side = c;
      short_side1 = a;
      short_side2 = b;
    } else {
      // aが一番長い
      long_side = a;
      short_side1 = b;
      short_side2 = c;
    }
    int d1 = long_side * long_side;
    int d2 = short_side1 * short_side1 + short_side2 * short_side2;
    // 鈍角
    if (d1 > d2) {
      count_3++;
    } else if (d1 == d2) {
      // 直角
      count_1++;
    } else {
      // 鋭角
      count_2++;
    }
  }

}

C++: #include<cstdio>
int a,b,c;
int re[4]={-1};
void st(int* p,int* q){
int r;
if(*p<*q){
r=*p;*p=*q;*q=r;
}
return;
}
int main(void){
while(1){
re[0]++;
scanf("%d%d%d",&a,&b,&c);
st(&a,&b);st(&a,&c);st(&b,&c);
if(a>=b+c)break;
if(a*a>b*b+c*c)re[3]++;
else if(a*a<b*b+c*c)re[2]++;
else re[1]++;
}
printf("%d",re[0]);
for(a=1;a<4;a++){
printf(" %d",re[a]);
}
printf("\n");
return 0;
}

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

inline int sq(const int x) { return x * x; };

int main() {
    vector<int> s(3, 0);
    while(true) {
        vector<int> in(3);
        for(int i = 0; i < 3; i++) cin >> in[i];
        sort(in.begin(), in.end());
        if(in[0] + in[1] <= in[2]) break;
        int left = sq(in[2]);
        int right = sq(in[0]) + sq(in[1]);
        if(left == right) s[1]++;
        else if(left < right) s[0]++;
        else s[2]++;
    }
    cout << accumulate(s.begin(), s.end(), 0) << ' ' << s[1] << ' ' << s[0] << ' ' << s[2] << endl;
}