Go: ///
// File:  0582.go
// Author: ymiyamoto
//
// Created on Wed Feb 28 22:51:48 2018
//
package main

import (
	"bufio"
	"fmt"
	"os"
)

const (
	steep = iota
	orth
	obtuse
)

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

func triangle(a, b, c int) int {
	if a*a == b*b+c*c {
		return orth
	} else if b*b+c*c-a*a > 0 {
		return steep
	} else {
		return obtuse
	}
}

func main() {
	s := bufio.NewScanner(os.Stdin)

	var num, st, or, ob int
	for s.Scan() {
		var a, b, c int
		fmt.Sscan(s.Text(), &a, &b, &c)

		m, n1, n2 := max(a, b, c)
		if m < n1+n2 {
			switch triangle(m, n1, n2) {
			case steep:
				st++
			case orth:
				or++
			case obtuse:
				ob++
			}
			num++
		} else {
			break
		}
	}
	fmt.Println(num, or, st, ob)
}

Python: #input_f = "3 4 5\n2 1 2\n6 3 4\n1 1 1\n1 2 3"
def t_check(a,b,c):
    if a + b > c:
        if b + c > a:
            if a + c > b: return True
    return False



def f_check(a_, b_, c_):
    tmp = []
    tmp.append(a_)
    tmp.append(b_)
    tmp.append(c_)
    sqrts = []
    for i in range(3):
        sqrts.append(tmp[i]**2)
    m = max(sqrts)
    s = sum(sqrts)

    if m == (s - m): return(0)
    if m > (s - m): return(2)
    if m < (s - m): return(1)
    
    
counter=[0,0,0]
    
    
while(1):
    input_f = input()


    t = input_f.split("\n")[i].split()
    fn, sn, tn = int(t[0]),int(t[1]),int(t[2])
    if t_check(fn,sn,tn):
        counter[f_check(fn,sn,tn)] += 1
    else: break
    

print(sum(counter),counter[0], counter[1], counter[2])

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

int main(){

    bool holds = true;
    vector<int> mem(4,0);//0が三角形の数　１が直角　２が鋭角　３が鈍角
    vector<int> tri(3);

    while(holds){
        vector<int> node(3);
        int a,b,c;
        cin>>node[0]>>node[1]>>node[2];

        for(int i=0;i<3;i++){
            if(node[i] >= node[(i+1)%3] + node[(i+2)%3]){
                holds = false;
            }
            else {
               sort(node.begin(),node.end());
               a = node[2];
               b = node[1];
               c = node[0];
            }
        }

        if(holds){
            mem[0]++;
            if(a*a > b*b + c*c) mem[3]++;
            else if (a*a < b*b + c*c) mem[2]++;
            else mem[1]++;
        }
    }
    for(int i=0;i<3;i++){
        cout<<mem[i]<<" ";
    }
    cout<<mem[3]<<endl;
}

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 <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 <bits/stdc++.h>
using namespace std;

int main(){
  std::vector<int> v(3);
  int a,b,c;
  a=b=c=0;
  for(int i=0;i<100;i++){
    cin>>v[0]>>v[1]>>v[2];
    sort(v.begin(),v.end());
    if(v[2]>=v[0]+v[1]){
      cout<<i<<" "<<a<<" "<<b<<" "<<c<<endl;
      break;
    }
    else{
      if(v[2]*v[2]==v[0]*v[0]+v[1]*v[1])a++;
      if(v[2]*v[2]<v[0]*v[0]+v[1]*v[1])b++;
      if(v[2]*v[2]>v[0]*v[0]+v[1]*v[1])c++;
    }
  }
}

C++: #include<stdio.h>
 
int main(){
	int a[3], b, i, j, e = 0, f = 0, g = 0, h = 0;
	while(scanf("%d %d %d", &a[0], &a[1], &a[2]) != EOF){
		for(i = 0; i < 2; i++){
			for(j = i + 1; j < 3; j++){
				if(a[i] < a[j]){
					b = a[i];
					a[i] = a[j];
					a[j] = b;
				}
			}
		}
		if(a[0] >= a[1] + a[2]) break;
		else e++;
		if(a[0] * a[0] > a[1] * a[1] + a[2] * a[2]) f++;
		else if(a[0] * a[0] == a[1] * a[1] + a[2] * a[2]) g++;
		else h++;
	}
	printf("%d %d %d %d\n", e, g, h, f);
	return 0;
}

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

int main() {
	// your code goes here
	int ch, ei, don;
	int n = 0;
	ch = 0;
	ei = 0;
	don = 0;
	
	while (true) {
		vector <int> l(3);
		cin >> l[0];
		cin >> l[1];
		cin >> l[2];
		std::sort(l.begin(), l.end());
		if (l[0] + l[1] > l[2] && l[1] + l[2] > l[0] && l[2] + l[0] > l[1]) {
			n++;
			if (l[2] * l[2] == l[0] * l[0] + l[1] * l[1]) {
				ch++;
			} else if (l[2] * l[2] > l[0] * l[0] + l[1] * l[1]) {
				don++;
			} else {
				ei++;
			}
		} else {
			break;
		}
	}
	cout << n << " " << ch << " " << ei << " " << don << endl;
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a[3];
	int t = 0, x = 0, y = 0, z = 0;
	bool b = true;
	while (cin >> a[0] >> a[1] >> a[2]){
		if (!b)continue;
		sort(a, a + 3);
		if (a[0] + a[1] <= a[2]){
			b = false;
			continue;
		}else{
			t++;
			if		(a[0] * a[0] + a[1] * a[1] == a[2] * a[2])y++;
			else 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++;
		}
	}
	cout << t << ' ' << x << ' ' << y << ' ' << z << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,count1=0,count2=0,count3=0,count4=0;
  while(cin>>a>>b>>c ){
      int ia,ib,ic,max,z;
      ia=a*a;
      ib=b*b;
      ic=c*c;
      if(ia>=ib && ia>=ic) {
	if(a<b+c) {
	  max=ia;
	  ia=ic;
	}
	else break;
      }
      
      else if(ib>=ia && ib>=ic) {
	if(b<a+c) {
	  max=ib;
	  ib=ic;
	}
	else break;
      }
      else if(ic>=ia && ic>=ib) {
	if(c<a+b) {
	  max=ic;
	}
	else break;
      }
      else break;
      count1++;
      if(max==ia+ib) count2++;
      else if(max<ia+ib) count3++;
      else count4++;
      break;
  }
  cout<<count1<<" "<<count2<<" "<<count3<<" "<<count4<<endl;
  return 0;
  
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int a[3];
int cnt,b,c,d;
main()
{
    while(cin>>a[0]>>a[1]>>a[2])
    {
        sort(a,a+3);
        if(a[0]+a[1]<=a[2])
        {
            cout<<cnt<<" "<<b<<" "<<c<<" "<<d<<endl;
            return 0;
        }
        cnt++;
        for(int i=0;i<3;i++)a[i]*=a[i];
        if(a[0]+a[1]==a[2])b++;
        else if(a[0]+a[1]<a[2])d++;
        else c++;
    }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  vector<int> hen(3),ans(4);
  fill(ans.begin(),ans.end(),0);

  while(cin >> hen[0] >> hen[1] >> hen[2]){

    sort(hen.begin(),hen.end());

    if(hen[2] < hen[0] + hen[1]){
      ans[0]++; 
      if(hen[2]*hen[2] < hen[0]*hen[0] + hen[1]*hen[1]){
	ans[2]++;
      }else if(hen[2]*hen[2] > hen[0]*hen[0] + hen[1]*hen[1]){
	ans[3]++;
      }else ans[1]++;

    }else break;
  }
  for(int i = 0 ; i < 4 ; i++ ){
    if(i == 0)cout << ans[0];
    else cout <<' '<< ans[i];
  }
  cout << endl;

  return 0;
}