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)
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	ll sankaku=0ll,eikaku=0ll,chokkaku=0ll,donkaku=0ll;
	while(1)
	{
		int a,b,c;
		cin >> a >> b >> c;
		if(a+b>c&&a+c>b&&b+c>a)
		{
			sankaku++;
			if(a*a+b*b==c*c||b*b+c*c==a*a||c*c+a*a==b*b)chokkaku++;
			else if(a*a+b*b<c*c||b*b+c*c<a*a||c*c+a*a<b*b)donkaku++;
			else eikaku++;
		}
		else
		{
			cout <<sankaku<<' '<<chokkaku<<' '<<eikaku<<' '<<donkaku<<endl;
			break;
		}
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;

int main()
{
	vector<int> r(3);
	int tcounter = 0;
	int ecounter = 0;
	int dcounter = 0;
	for (int i = 0; i < 100000000; i++) {
		cin >> r[0] >> r[1] >> r[2];
		sort(r.begin(), r.end());
		if (r[0] + r[1] > r[2]) {
			if (r[0] * r[0] + r[1] * r[1] > r[2] * r[2]) ecounter++;
			else if (r[0] * r[0] + r[1] * r[1] < r[2] * r[2]) dcounter++;
			else tcounter++;
		}
		else {
			cout << i << " " << tcounter << " " << ecounter << " " << dcounter << endl;
			break;
		}
	}
}

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

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int h[3],ans[4]={0};
	bool check=true;
	while(cin>>h[0]>>h[1]>>h[2]){
		sort(h,h+3);
		if(h[2]>=h[1]+h[0])
			check=false;
		if(check==true){
			ans[0]++;
			if(h[0]*h[0]+h[1]*h[1]>h[2]*h[2])
				ans[2]++;
			if(h[0]*h[0]+h[1]*h[1]==h[2]*h[2])
				ans[1]++;
			if(h[0]*h[0]+h[1]*h[1]<h[2]*h[2])
				ans[3]++;
		}
	}
	for(int i=0;i<3;i++)
		cout<<ans[i]<<" ";
	cout<<ans[3]<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int cnt[4]={};
  int a[3];
  while(cin>>a[0]>>a[1]>>a[2]){
    sort(a,a+3);
    if(a[2]>=a[1]+a[0])break;
    for(int i=0;i<3;i++)a[i]*=a[i];
    cnt[0]++;
    if(a[2]==a[1]+a[0])cnt[1]++;
    else if(a[2]<a[1]+a[0])cnt[2]++;
    else cnt[3]++;
  }
  cout<<cnt[0]<<" "<<cnt[1]<<" "<<cnt[2]<<" "<<cnt[3]<<endl;
  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; // 鈍角
  for (int l = 0; l < 100; l++) {
    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 << 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;
    }
    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<iostream>
#include<cmath>
#include<algorithm>

using namespace std;

int main() {
	
	int Length[3];
	
	while(scanf("%d %d %d", &Length[0], &Length[1], &Length[2]) != EOF) {

	int Trinagle[4] = {};	
	sort(Length, Length+3);
	
	if( Length[0] + Length[1] <= Length[2] ) {
		
        cout << Trinagle[0] << " " << Trinagle[1] << " "
		 	<< Trinagle[2] << " " << Trinagle[3] << "\n";
		 	return 0;
        }
	
	Trinagle[0]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) == pow(Length[2], 2) )
	Trinagle[1]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) < pow(Length[2], 2) )
	Trinagle[2]++;
	
	if( pow(Length[0], 2) + pow(Length[1], 2) > pow(Length[2], 2) )
	Trinagle[3]++;
	
	}
}

C++: #include"iostream"
#include"algorithm"
using namespace std;

int main()
{
  int a,b,c;
  int count=0;
  int acute=0,right=0,obtuse=0;
  while(cin>>a>>b>>c){
    if(b<c){
      swap(b,c);
    }
    if(a<b){
      swap(a,b);
    }
    if(a>=b+c){
      cout<<count<<" "<<right<<" "<<acute<<" "<<obtuse<<endl;
      break;
    }
    if(a*a<b*b+c*c){
      acute++;
    }else if(a*a==b*b+c*c){
      right++;
    }else{
      obtuse++;
    }
    count++;
  }
  return 0;
}

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


}

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

using namespace std;

int main()
{
	int a, b, c;
	int na, nb, nc, nd;
	
	na = nb = nc = nd = 0;
	while (1){
		scanf("%d %d %d", &a, &b, &c);
		if (a < b) swap(a, b); if (a < c) swap(a, c);
		if (a >= b + c) break;
		
		na++;
		if (b * b + c * c == a * a) nc++;
		else if (b * b + c * c < a * a) nd++;
		else nb++;
	}
	printf("%d %d %d %d\n", na, nb, nc, nd);
	
	return (0);
}

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