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.)
Write a program that given three edge sizes determines whether a triangle is scalene, isosceles, equilateral or impossible.
The input consists of a single line with three natural numbers x, y and z where 0 < x, y, z < 100
The output should contain a single line with just
scalene
,
isosceles
,
equilateral
or impossible
.
3 4 5
scalene
3 3 1
isosceles
6 2 3
impossible
4 4 4
equilateral
try next: factorial1
Copyright © 2020-2021 Rudy Matela