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 <iostream>
#include <algorithm>
using namespace std;

int main()
{
  int len[3];
  int type[3] = {0};

  while (~scanf("%d%d%d", &len[0], &len[1], &len[2])){
    sort(len, len + 3);

    if (len[0] + len[1] <= len[2]) break;
    else if (len[0] * len[0] + len[1] * len[1] == len[2] * len[2]){
      type[0]++;
    }
    else if (len[0] * len[0] + len[1] * len[1] > len[2] * len[2]){
      type[1]++;
    }
    else if (len[0] * len[0] + len[1] * len[1] < len[2] * len[2]){
      type[2]++;
    }
  }

  printf("%d %d %d %d\n", type[0] + type[1] + type[2], type[0], type[1], type[2]);

  return (0);
}

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

int main(){
    int inp[3], tyoku = 0, don = 0, ei = 0;
    for (int i = 0; i < 5; i++){
        scanf("%d %d %d",&inp[0], &inp[1], &inp[2]);
        sort(inp, inp + 3);
        
        if(inp[0] + inp[1] > inp[2]){
            int p = inp[0]*inp[0] + inp[1]*inp[1];
            int q = inp[2]*inp[2];
            if(p == q) tyoku++;
            else if(p < q) don++;
            else ei++;
        }
    }
    
    printf("%d %d %d %d¥n", tyoku +don +ei, tyoku,ei,don);
    return 0;
}

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

using namespace std;

int main(){
    int p[3];
    int donkaku=0,eikaku=0,tyokkaku=0;
    while(cin>>p[0]>>p[1]>>p[2]){
        sort(p,p+3);
        if(p[0]+p[1]<=p[2]){
            cout<<donkaku+eikaku+tyokkaku<<" "<<tyokkaku<<" "<<eikaku<<" "<<donkaku<<endl;break;
        }
        if(p[2]*p[2]<p[1]*p[1]+p[0]*p[0])eikaku++;
        else if(p[2]*p[2]>p[1]*p[1]+p[0]*p[0])donkaku++;
        else tyokkaku++;
        
    }
    return 0;
    
}

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

int main(){
  int a;
  int b;
  int c;
  int shahen;
  int hoge;
  int san_ei=0;
  int san_do=0;
  int san_ty=0;
  int san=0;
  
  for(;;){
    cin >> a >> b >> c;
    
    if(a<b){hoge=a; a=b; b=hoge;}
    if(a<c){hoge=a; a=c; c=hoge;}

    if(a+b>c && b+c>a && c+a>b){
      shahen=a*a;
      if(shahen==b*b+c*c){
	san_ty++;
      }else if(shahen>b*b+c*c){
	san_do++;
      }else if(shahen<b*b+c*c){
	san_ei++;
      }
      san++;
    }else{
      cout << san << " " << san_ty << " " << san_ei << " "  << san_do << "" << endl;
    break;
    }


  }
    
  return 0;
}

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

int main(){
	int a,b,c;
	int ca,cb,cc,cd;
	int l[3];
	while(cin>>l[0]>>l[1]>>l[2]){
		sort(l,l+3);
		a=l[0];
		b=l[1];
		c=l[2];
		if(c<a+b)
		ca++;
		
		if((a*a)+(b*b)==c*c)
		cb++;
		else if((a*a)+(b*b)>(c*c))
		cc++;
		else if((a*a)+(b*b)<(c*c))
		cd++;
		}
		cout<<ca<<" "<<cb<<" "<<cc<<" "<<cd<<endl;
		return 0;
	}

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

using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a[3],w=0,x=0,y=0,z=0,b=0;
  while(b==0){
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    if(a[2]<a[0]+a[1]&&b==0){
      w++;
      if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1])x++;
      if(a[2]*a[2]>a[0]*a[0]+a[1]*a[1])z++;
      if(a[2]*a[2]<a[0]*a[0]+a[1]*a[1])y++;
    }else b++;
  }
  cout<<w<<" "<<x<<" "<<y<<" "<<z<<endl;
}

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

using namespace std;

int a[3];
int cnt[4];

bool calc(){
  for(int i=0;i<3;i++){
    if(a[i] + a[(i+1)%3] <= a[(i+2)%3]) return false;
  }
  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]++;
  return true;
}

main(){
  fill(cnt, cnt+4, 0);
  bool f = true;
  while(cin >> a[0] >> a[1] >> a[2]){
    sort(a, a+3);
    if(f){
      if(!calc()) f = false;
    }
  }
  for(int i=0;i<4;i++){
    if(i) cout << ' ';
    cout << cnt[i];
  }
  cout << endl;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
#include <deque>
#include <complex>
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define REP(i,a) FOR(i,0,a)
using namespace std;
int norm(int a){return a*a;}
int main() {
	int s[3],type[3]={},sum=0;
	while(true){
	REP(i,3)
			cin >>s[i];
	sort(s,s+3);
	if(s[0]+s[1]<=s[2])
		break;
	if(norm(s[0])+norm(s[1])==norm(s[2]))
	type[0]++;
	if(norm(s[0])+norm(s[1])<norm(s[2]))
	type[2]++;
	if(norm(s[0])+norm(s[1])>norm(s[2]))
	type[1]++;
	
	sum++;
	}
	cout <<sum;
	REP(i,3)
		cout <<" " << type[i];
	cout << endl;
	// your code goes here
	return 0;
}

C++: #include<cstdio>
int main() {
	int a, b, c, tmp, triangle = 0, right = 0, acute = 0, obtuse = 0;
	while (true) {
		scanf("%d%d%d", &a, &b, &c);
		if (a > b) { tmp = b; b = a; a = tmp; }
		if (b > c) { tmp = c; c = b; b = tmp; }
		if (a > b) { tmp = b; b = a; a = tmp; }
		if (a + b <= c) {
			printf("%d %d %d %d\n", triangle, right, acute, obtuse);
			break;
		}
		else if (a*a + b*b > c*c) acute++;
		else if (a*a + b*b == c*c) right++;
		else obtuse++;
		triangle++;
	}
	return 0;
}

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

int main(){

	bool flg = true;

	int r1 = 0, r2 = 0, r3 = 0;

	int data[3];
	while (std::cin >> data[0] >> data[1] >> data[2]){
		if (!flg)continue;

		std::sort(data, data + 3);

		if (data[2] >= data[1] + data[0]){
			std::cout << r1 + r2 + r3 << " " << r2 << " " << r1 << " " << r3 << std::endl;
			flg = false;
		}

		if (data[2] * data[2] < data[1] * data[1] + data[0] * data[0])r1++;
		if (data[2] * data[2] == data[1] * data[1] + data[0] * data[0])r2++;
		if (data[2] * data[2] > data[1] * data[1] + data[0] * data[0])r3++;
	}

	return 0;
}