index | submit | rank | book

triangle – Six Triangle Types (challenge)

Every triangle can be classified as either scalene, isosceles or equilateral:

(Some authors consider equilateral to be a special case of isosceles. For the purpose of this exercise, we use Euclid’s original definition and consider isosceles triangles those with exactly two edges of the same size.)

triangle types: scalene, isosceles, equilateral, impossible

All triangles can also be classified as right, obtuse and accute:

triangle angle types: obtuse, right, acute

Write a program that given three edge sizes determines:

Input and Output

Input consists of a several lines, each with three natural numbers x, y and z where

0 < x, y, z < 10 000

For each line of input, output should contain a line indicating both classifications or impossible.

Example input

3 4 5
3 3 1
6 4 3
1 1 1
7 2 3

Example output

scalene right
isosceles acute
scalene obtuse
equilateral acute
impossible

Scoring

try first: triangle1

try next: calc

index | submit | rank | book

Copyright © 2020-2021 Rudy Matela
All rights reserved