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<stdio.h>
int main()
{
    int d=0,t=0,e=0,a,b,c,A,B,C,h;
    while(1){
        scanf("%d%d%d",&a,&b,&c);
        if(a>b&&a>c){
            C=a;
            A=b;
            B=c;
        }else if(b>a&&b>c){
            B=c;
            C=b;
            A=a;
        }else{
            A=a;
            B=b;
            C=c;
        }
        if(A+B<=C){
            printf("%d %d %d %d\n",d+t+e,t,e,d);
            break;
        }
        h=A*A+B*B-C*C;
        if(h>0){
            e++;
        }else if(h<0){
            d++;
        }else{
            t++;
        }
    }
    return 0;
}

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

int main() {
  vector<int> cnt(3,0);
  while(true) {
    vector<int> v(3);
    cin >> v[0] >> v[1] >> v[2];
    sort(v.begin(),v.end());
    if(v[2] >= v[0]+v[1])
       break;
    if(v[2]*v[2] > v[0]*v[0] + v[1]*v[1])
      cnt[2]++;
    else if(v[2]*v[2] == v[0]*v[0] + v[1]*v[1])
      cnt[1]++;
    else
      cnt[0]++;
  }
  cout << cnt[0] + cnt[1] + cnt[2] << " " << cnt[1] << " " << cnt[0] << " " << cnt[2] << endl;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define first F
#define second S

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  vi l(3);
  vi n(4,0);
  while(scanf("%d %d %d",&l[0],&l[1],&l[2])!=EOF){
    sort(all(l));
    if(l[0]+l[1]>l[2])n[0]++;
    else continue;
    double cosine=double(l[0]*l[0]+l[1]*l[1]-l[2]*l[2])/(2*l[0]*l[1]);
    if(fabs(cosine)<EPS)n[1]++;
    else if(cosine>0)n[2]++;
    else if(cosine<0)n[3]++;
  }
  printf("%d %d %d %d\n",n[0],n[1],n[2],n[3]);
}

C++: #include<iostream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define ll2(x, y) ll x, y; cin >> x >> y;
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << (x) << "\n"
#define debug2(x, y) cout << " --- " << (x) << " " << (y) << "\n"
#define debug3(x, y, z) cout << " --- " << (x) << " " << (y) << " " << (z) << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)

int a[3];
int res[4] = {0};

signed main(void){
  int i, j;
  for(int testcase = 0;testcase >= 0;testcase++){
    scanf("%d%d%d", &a[0], &a[1], &a[2]);
    sort(a, a + 3);
    ++res[0];
    if(a[0] <= 0 || a[1] <= 0 || a[2] <= 0 || a[2] >= a[1] + a[0])break;
    else if(a[2] * a[2] == a[0] * a[0] + a[1] * a[1])++res[1];
    else if(a[2] * a[2] > a[0] * a[0] + a[1] * a[1])++res[3];
    else ++res[2];


//*/

//*/ break;
  }
  printf("%d %d %d %d\n", res[0] - 1, res[1], res[2], res[3]);
  return 0;
}

C++: #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a[3];
  int ans[4]; // 個数直角鋭角鈍角
  CLR(ans);
  while(cin>>a[0]>>a[1]>>a[2]) {
    sort(a,a+3);
    if(a[2] >= a[1] + a[0]) break;
    ans[0]++;
    if(a[2]*a[2]==a[1]*a[1]+a[0]*a[0]) ans[1]++;
    if(a[2]*a[2]<a[1]*a[1]+a[0]*a[0]) ans[2]++;
    if(a[2]*a[2]>a[1]*a[1]+a[0]*a[0]) ans[3]++;
  }
  FOR(i,0,4) {
    if(i) cout << " ";
    cout << ans[i];
  }
  cout << endl;
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int t[3],x,y;
int a=0,b=0,c=0;
int main(){
  while(1){
    cin>>t[0]>>t[1]>>t[2];
    sort(t,t+3);
    x=t[0]*t[0]+t[1]*t[1];
    y=t[2]*t[2];
    if(t[0]+t[1]<=t[2]){
      break;
    }else if(x==y){
      a++;
    }else if(x>y){
      b++;
    }else if(x<y){
      c++;
    }
  }
  cout<<a+b+c<<' '<<a<<' '<<b<<' '<<c<<endl;
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int a[3];
  int s=0,e=0,d=0,t=0;
  while(cin>>a[0]>>a[1]>>a[2]){
    sort(a,a+3);
    if(a[0]+a[1]>a[2]){
      s++;
      if(a[0]*a[0]+a[1]*a[1]<a[2]*a[2]) d++;
      else if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2]) t++;
      else if(a[0]*a[0]+a[1]*a[1]>a[2]*a[2]) e++;
    }
  }
  cout << s << ' ' << t << ' ' << e << ' ' << d << endl;
  return 0;
}

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

using namespace std;

int sankaku,eikaku,tyokkaku,donkaku;
int hen[3];
bool musi;

int main(void){

  sankaku = eikaku = tyokkaku = donkaku = 0;
  musi = false;

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

    if( !musi ){

      sort( hen , hen + 3 );

      if( hen[2] >= hen[0] +  hen[1] ){
	musi = true;
	continue;
      }
      sankaku++;

      for( int i = 0 ; i < 3 ; i++ )
	hen[i] = pow( (double)hen[i] , 2 );

      if( hen[2] == hen[0] + hen[1] ) tyokkaku++;
      if( hen[2] < hen[0] + hen[1] ) eikaku++;
      if( hen[2] > hen[0] + hen[1] ) donkaku++;
      
      
    }
  }
  cout << sankaku << " " << tyokkaku << " " << eikaku << " " << donkaku << endl;
  return 0;
}