Triangle Type
Completed
Read three side lengths on one line. Print invalid if they can't form a triangle (the two shorter sides must add up to more than the longest). Otherwise print equilateral, isosceles or scalene.
Input
Three positive integers.
Output
One word.
Example
Input
3 3 3
Output
equilateral
Editor
Python
Hints
Sorting the sides puts the longest last.
After sorting, all equal means a == c.
Solution explanation
Sorting first removes the need to check every ordering of the sides.
Show solution
a, b, c = sorted(map(int, input().split()))
if a + b <= c:
print("invalid")
elif a == c:
print("equilateral")
elif a == b or b == c:
print("isosceles")
else:
print("scalene")