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

Python: sankaku = 0
eikaku = 0
donkaku = 0
chokkaku = 0

for xi in range(1, 10000000000000000):
    inline = input().split()
    a, b, c = (int(xi) for xi in inline)
    if c <a:
        sub = a
        a = c
        c = sub
    if c <b:
        sub = b
        b = c
        c = sub
    if c >= a + b:
        break

    c2 = c**2
    b2 = b**2
    a2 = a**2

    if c2 == b2+a2:
        chokkaku += 1

    if c2 < b2+a2:
        eikaku += 1

    if c2 > b2+a2:
        donkaku += 1

    sankaku += 1

print(sankaku, chokkaku, eikaku, donkaku)

Python: ans_n = 0
ans_a = 0
ans_r = 0
ans_o = 0
while True:
    #辺の長さの入力
    a, b, c = map(int, input().split())
    #辺の長さの並び替え
    l = sorted([a, b, c])
    f = l[0]
    s = l[1]
    t = l[2]
    #ここから条件分岐
    if t >= f + s:
        break
    elif t ** 2 < f ** 2 + s ** 2:
        ans_n += 1
        ans_a += 1
    elif t ** 2 == f ** 2 + s ** 2:
        ans_n += 1
        ans_r += 1
    elif t ** 2 > f ** 2 + s ** 2:
        ans_n += 1
        ans_o += 1
print(str(ans_n) + " " + str(ans_r) + " " + str(ans_a) + " " + str(ans_o))

Python: sankaku = 0
tyokkaku = 0
eikaku = 0
donkaku = 0
while True:
    inputed_line = input()
    data_str = inputed_line.split(' ')
    data = [int(i) for i in data_str]
    data.sort()
    if data[-1] < data[0] + data[1]:
        sankaku += 1
        if data[-1] ** 2 == data[0] ** 2 + data[1] ** 2:
            tyokkaku += 1
        elif data[-1] ** 2 < data[0] ** 2 + data[1] ** 2:
            eikaku += 1
        elif data[-1] ** 2 > data[0] ** 2 + data[1] ** 2:
            donkaku += 1
    else:
        break

answer_list = [sankaku, tyokkaku, eikaku, donkaku]
answer_list_str = [str(i) for i in answer_list]
answer_str = ' '.join(answer_list_str)
print(answer_str)

Python: lista=[]
t=0
ch=0
e=0
d=0
tflag=1
while True:
    try:
        lista.append(list(map(int,input().split())))
    except:
        break;

def func01(a,b,c):
    global t
    global ch
    global e
    global d
    global tflag
    if a+b>c:
        t+=1
        if a**2+b**2==c**2:
            ch+=1
        elif a**2+b**2>c**2:
            e+=1
        elif a**2+b**2<c**2:
            d+=1
    else:
        tflag=0
        
i=0
for i in range(len(lista)):
    if len(lista)==i:
        break
    x=sorted(lista[i])
    func01(x[0],x[1],x[2])
    if tflag==0:
        break
    i+=1
print(t,ch,e,d)

Python: tri = {} # 1: normal, chokkaku, eikaku donkaku
for i in range(4) :
    tri[i + 1] = 0
    
while(True) :
    l = sorted(map(int, input().split()), reverse=True)
    a, b, c = l[0], l[1], l[2]
    
    if a >= b + c :
        break
    else :
        if b ** 2 + c ** 2 == a ** 2:
            tri[1] += 1
        elif b ** 2 + c ** 2 > a ** 2:
            tri[2] += 1
        else :
            tri[3] += 1
            
print(sum(tri.values()), tri[1], tri[2], tri[3])

Python: al=0
tyo=0
ei=0
don=0

while True:
    s=list(map(int,input().split())) 
    s.sort(reverse=True)
    if s[0]+s[1]>s[2] and s[1]+s[2]>s[0] and s[2]+s[0]>s[1]:
        al+=1
        tmp=s[0]*s[0]-(s[1]*s[1]+s[2]*s[2])
        if tmp==0:
           tyo+=1
        elif tmp<0:
            ei+=1
        else:
            don+=1
    else:
        print(al,tyo,ei,don)
        break

Python: def run():
    judge = [0, 0, 0, 0]
    while True:
        a, b, c = (int(x) for x in sorted(input().split()))
        if a + b <= c or min([a, b, c]) <= 0:
            print(' '.join(map(str, judge)))
            print()
            break
        else:
            S = a ** 2 + b ** 2 - c ** 2
            judge[0] += 1
            if S == 0:
                judge[1] += 1
            elif S < 0:
                judge[2] += 1
            else:
                judge[3] += 1





if __name__ == '__main__':
    run()

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0582

"""
import sys
from sys import stdin
from math import asin, pi, sqrt, degrees
input = stdin.readline


def main(args):
    triangle = 0                #  ????§???¢?????°
    right_triangle = 0          #  ??´?§?????§???¢
    acute_triangle = 0          #  ????§?????§???¢
    obtuse_triangle  = 0        #  ????§?????§???¢
    while True:
        lines = [int(x) for x in input().split()]
        lines.sort()
        a, b, c = lines[0], lines[1], lines[2]
        if a + b <= c:
            break
        triangle += 1

        if a**2 + b**2 == c**2:
            right_triangle += 1
            continue
        s = (a + b + c) / 2
        area = sqrt(s * (s - a) * (s - b) * (s - c))
        h = (2 * area) / c
        A = degrees(asin(h / b))
        B = degrees(asin(h / a))
        C = 180 - (A + B)
        if A < 90 and B < 90 and C < 90:
            acute_triangle += 1
        else:
            obtuse_triangle += 1

    print(triangle, right_triangle, acute_triangle, obtuse_triangle)


if __name__ == '__main__':
    main(sys.argv[1:])

Python: def triangle():
    # 直角三角形の成立条件
    if length[0]**2 == length[1]**2 + length[2]**2:
        n[0] += 1; n[1] += 1
    # 鋭角三角形の成立条件
    elif length[0]**2 < length[1]**2 + length[2]**2:
        n[0] += 1; n[2] += 1
    # 鈍角三角形の成立条件
    elif length[0]**2 > length[1]**2 + length[2]**2:
        n[0] += 1; n[3] += 1
    
    return n

def print_n():
    for i, num in enumerate(n):
        if i == len(n) - 1:
            print(num)
        else:
            print(num, end=' ')

n = [0, 0, 0, 0]
while True:
    length = sorted(list(map(int, input().split())), reverse=True)
    # 三角形の成立条件
    if length[0] < length[1] + length[2]\
    and length[1] < length[0] + length[2]\
    and length[2] < length[1] + length[0]:
        n = triangle()
    else:
        break
print_n()

Python: import sys

def triangle_check(a, b, c):
    e1, e2, e3 = sorted([a, b, c], reverse=True)
    if e1 <= 0 or e2 <= 0 or e3 <= 0: return 0
    if e1 > e2 + e3: return 0
    if e1**2 == e2**2 + e3**2: return 2
    elif e1**2 < e2**2 + e3**2: return 1
    elif e1**2 > e2**2 + e3**2: return 3

ans = [0 for i in range(4)]

lines = sys.stdin.readlines()
for line in lines:
    a, b, c = list(map(int, line.split(' ')))
    rst = triangle_check(a, b, c)
    if rst == 0:
        print(' '.join(list(map(str, ans))))
        break
    ans[0] += 1
    ans[rst] += 1

Python: right,acute,obtuse = 0,0,0

while True:
    triangle = sorted([int(i) for i in input().split()])

    # 三角形の成立条件
    if triangle[2] < triangle[0] + triangle[1]:
        longest_2 = triangle[2] ** 2
        side1_2 = triangle[0] ** 2
        side2_2 = triangle[1] ** 2
        # 直角三角形の成立条件
        if longest_2 == side1_2 + side2_2:
            right += 1
        # 鋭角三角形の成立条件
        elif longest_2 < side1_2 + side2_2:
            acute += 1
        # どちらでもないなら鈍角三角形
        else:
            obtuse += 1
    # 三角形ではないときは終了する
    else:
        break

print('%d %d %d %d' % (right+acute+obtuse,right,acute,obtuse))