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>
int main(void){
    
    int a=0,b=0,c=0;
    int change=0;
    int right=0,obtuse=0,acute=0;
    int value=0,check=0,count=0;
    int flag=true;
    while(flag){
        count++;
        scanf("%d%d%d",&a,&b,&c);
        if(c<a){
            change=a;
            a=c;
            c=a;
        }
        if(c<b){
            change=b;
            a=b;
            b=a;
        }
        check=a+b-c;
        value=a*a+(b*b-c*c);
        if(check<=0){
            break;
        }
        if(value==0){
            right++;
        }
        else if(value<0){
            obtuse++;
        }
        else{
            acute++;
        }
    }
    printf("%d %d %d %d",count,right,obtuse,acute);
    return 0;
}

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

bool ignore;
int right;
int acute;
int obtuse;

int main() {
    while (1) {
        int es[3];
        int p, q;

        if (scanf("%d %d %d", &es[0], &es[1], &es[2]) == EOF) return 0;
        if (ignore) continue;

        sort(es, es+3);
        if (es[0]+es[1] <= es[2]) {
            ignore = true;
            printf("%d %d %d %d\n", right+acute+obtuse, right, acute, obtuse);
            continue;
        }

        p = es[0]*es[0] + es[1]*es[1];
        q = es[2]*es[2];
        if (p == q) right++;
        else if (p > q) acute++;
        else obtuse++;
    }
}

C++: #include <iostream>
#include <algorithm>
#include <ios>     // std::left, std::right
#include <iomanip> // std::setw(int), std::setfill(char)
#include <string>
#include <cmath>
#include <vector>
using namespace std;

int main(int argc, char const *argv[]) {
    int tri[100][3];
    int cnt[4] = {0};

    while(true){
        vector<int> point(3);
        cin >> point[0] >> point[1] >> point[2];
        sort(point.begin(), point.end());
        int x = point[0];
        int y = point[1];
        int z = point[2];
        if (x+y <= z) break;
        cnt[0]++;
        if (x*x + y*y == z*z){
            cnt[1]++;
        } else if (x*x + y*y > z*z){
            cnt[2]++;
        } else {
            cnt[3]++;
        }
    }
    for (int i = 0; i < 3; i++){
        cout << cnt[i] << " ";
    }
    cout << cnt[3] << endl;
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),in.end()
#define PI acos(-1)
using namespace std;
int main(){
  int a,b,c;
  int x=0,y=0,z=0,w=0;
  while(cin>>a>>b>>c){
    vector<int>in(3);
    in[0]=a;in[1]=b;in[2]=c;
    sort(all(in));
    if(in[0]+in[1]<=in[2])break;
    x++;    
    if(in[0]*in[0]+in[1]*in[1]==in[2]*in[2])y++;
    if(in[0]*in[0]+in[1]*in[1]>in[2]*in[2])z++;
    if(in[0]*in[0]+in[1]*in[1]<in[2]*in[2])w++;
  }
  cout<<x<<" "<<y<<" "<<z<<" "<<w<<endl;
}

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

using namespace std;

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

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

int main(){
  vector<int> a(3);
  int cnt[4] = {0, 0, 0, 0};
  while (cin >> a[0] >> a[1] >> [2]) {
    if (a[0] + a[1] > a[2] && a[0] + a[2] > a[1] && a[1] + a[2] > a[0]) {
      cnt[0] ++;
      sort(a.begin(), a.end());
      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] ++;
    }
  }

  cout << cnt[0];
  cout << " " << cnt[1];
  cout << " " << cnt[2];
  cout << " " << cnt[3];
  cout << endl;
}

C++: #include<bits/stdc++.h>
#include <stdio.h>
#include<iostream.h>
#include<algorithm>
using namespace std;
int main()
{
	int a,b,c,right,obtuse,acute,tri;
	cin >> a,b,c;
	right,obtuse,acute,tri = 0;
	int sides[3] = {a,b,c};
	sort(sides[0],sides[2]);
	while (sides[2]<sides[0]+sides[1])
	{
		if (sides[2]*sides[2] == sides[0]*sides[0]+sides[1]*sides[1])
		{
			tri += 1;
			right += 1;
		}
		else if (sides[2]*sides[2] > sides[0]*sides[0]+sides[1]*sides[1])
		{
			tri += 1;
			obtuse += 1;
		}
		else
		{
			tri += 1;
			acute += 1;
		}
	}
	{
		printf("%d %d %d %d",tri,right,obtuse,acute);
	}	
}

C++: #include <algorithm>
#include <cstdio>
#include <cstdlib>
using namespace std;

constexpr inline int square(int x) {
	return x * x;
}

int main() {
	int edge[3];
	int triangle = 0;
	int right	 = 0;
	int acute	 = 0;
	int obtuse	 = 0;

	while(scanf("%d %d %d", edge, edge + 1, edge + 2) == 3) {
		sort(edge, edge + 3);

		if(edge[0] + edge[1] <= edge[2]) {
			printf("%d %d %d %d\n", triangle, right, acute, obtuse);
			continue;
		}

		++triangle;
		const int a = square(edge[0]) + square(edge[1]);
		const int b = square(edge[2]);

		if(a == b) ++right;
		else if(a > b) ++acute;
		else ++obtuse;
	}

	return EXIT_SUCCESS;
}

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

int main() {
        int a, b, c, ab, cc;
        int i, j, x;
        int ai=0, dn=0, tk=0, sa=0;

        while(1) {
                cin >> a >> b >> c;
                if (a > b) {
                        x = b;
                        b = a;
                        a = x;
                }
                if (b > c) {
                        x = c;
                        c = b;
                        b = x;
                }
                if ((a + b) <= c) {
                        break;
                }
                sa++;
                ab = (a * a) + (b * b);
                cc = c * c;
                if (ab == cc) {
                        tk++;
                } else {
                        if (ab > cc) ai++;
                        if (ab < cc) dn++;
                }
        }
        cout << sa << " " << tk << " " << ai << " " << dn << endl;
        return 0;
}