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 <iostream>
#include <cmath>

#define RIGHT 1
#define ACUTE 2
#define OBTUSE 3

using namespace std;

void sort(int *a, int *b, int *c) {
	int lines[3] = { *a, *b, *c };

	bool changed = true;

	while(changed) {
		changed = false;

		for(int i = 0;i < 2;i++) {
			if(lines[i] > lines[i + 1]) {
				int tmp;

				tmp = lines[i];
				lines[i] = lines[i + 1];
				lines[i + 1] = tmp;

				changed = true;
			}
		}
	}

	*a = lines[0];
	*b = lines[1];
	*c = lines[2];
}

int main() {
	int a, b, c;
	int triangles[4] = { 0 };
	int result = 0;

	while(cin >> a >> b >> c) {
		sort(&a, &b, &c);
		
		if(c < (a + b)) {
			triangles[0]++;

			int pow_ab = pow(a, 2) + pow(b, 2);
			int pow_c = pow(c, 2);

			if(pow_c == pow_ab) {
				result = RIGHT;
			} else if(pow_c < pow_ab) {
				result = ACUTE;
			} else if(pow_c > pow_ab) {
				result = OBTUSE;
			}

			triangles[result]++;
		} else {
			continue;
		}
	}

	for(int i = 0;i < 4;i++) {
		cout << triangles[i];

		if(i < 3) {
			cout << " ";
		}
	}

	cout << endl;

	return 0;
}

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

using namespace std;

int main() {
	
	int Length[3];
	int Triangle[4] = {0};
	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( Length[0] * Length[0] + Length[1] * Length[1] 
	== Length[2] * Length[2] )
	Triangle[1]++;
	
	else if(Length[0] * Length[0] + Length[1] * Length[1] 
	> Length[2] * Length[2] )
	Triangle[2]++;
	
	else
	Triangle[3]++;
	
	Triangle[0]++;
	}

	cout << Triangle[0] << " " << Triangle[1] << " "
		 << Triangle[2] << " " << Triangle[3] << "\n";
	return 0;
}

C++: #include <iostream>
#include <math.h>
#include <string>
#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std;

int main(void)
{
    int a[100], b[100], c[100],A,B,C,D,P,PP,s1,s2,s3;
    A = 0;
    B = 0;
    C = 0;
    D = 0;
    P = 0; 
    PP = 0;
    s1 = 0;
    s2 = 0;
    s3 = 0; 

    for (int i = 0; i < 100; i++)
    {
        cin >> a[i];
        s1 = a[i];
        cin >> b[i];
        if (b[i] >= s1)
        {
            s1 = 0;
            s1 = b[i];
            s2 = 0;
            s2 = a[i];
        }
        else
        {
            s2 = b[i];
        }
        cin >> c[i];
        if (c[i] >= s1)
        {
            s3 = 0;
            s3 = s2;
            s2 = 0;
            s2 = s1;
            s1 = 0;
            s1 = c[i];
           
        }
        else if (c[i] >= s2)
        {
            s3 = 0;
            s3 = s2;
            s2 = 0;
            s2 = c[i];
        }
        else
        {
            s3 = c[i];
        }

        P = (s2 * s2) + (s3 * s3);
        PP = s1 * s1;

        if (a[i] + b[i] > c[i] && b[i] + c[i] > a[i])
        {
            if (c[i] + a[i] > b[i])
            {
                A += 1;
                if (P == PP)
                {
                    B += 1;

                }
                else if (P > PP)
                {
                    C += 1;
                }
                else if (P < PP)
                {
                    D += 1;
                }

            }
            else
            {
                cout << A << " " << B << " " << C << " " << D << endl;
                break;
            }
        }
        else
        {
            cout << A << " " << B << " " << C << " " << D << endl;
            break;
        }
    }

}

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

using namespace std;

int main(int argc, char const* argv[])
{
	string str;
	int ei = 0;
	int ty = 0;
	int don = 0;
	while(getline(cin, str)){
			istringstream iss(str);
			int x, y, z;
			iss >> x >> y >> z;
			int maxi = max(x, max(y, z));
			if(maxi == x){
					if(x < y + z){
							if(y * y + z * z - x * x > 0){
									ei++;
							}else if(y * y + z * z - x * x < 0){
									don++;
							}else{
									ty++;
							}
					}else{
							break;
					}
			}else if(maxi == y){
					if(y < x + z){
							if(x * x + z * z - y * y > 0){
									ei++;
							}else if(x * x + z * z - y * y < 0){
									don++;
							}else{
									ty++;
							}
					}else{
							break;
					}
			}else{
					if(z < x + y){
							if(x * x + y * y - z * z > 0){
									ei++;
							}else if(x * x + y * y - z * z < 0){
									don++;
							}else{
									ty++;
							}
					}else{
							break;
					}
			}
	}
	cout << ei + ty + don << " " << ty << " " << ei << " " << don << endl;
	return 0;
}