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 c, a, 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++: #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;

}