1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2024-12-08 00:45:29 +01:00
programming-challenges/challenges/triangle-type/README.md

21 lines
678 B
Markdown
Raw Normal View History

2021-06-30 12:25:29 +02:00
# triangle-type
2023-07-02 17:28:54 +02:00
Created by [@theoludwig](https://github.com/theoludwig) on 30 June 2021.
2021-06-30 12:25:29 +02:00
## Instructions
Given the lengths of the 3 sides of a triangle, your function should return whether it is `equilateral`, `isosceles`, `scalene` or `impossible`.
- A triangle is `equilateral` when its 3 sides are equal
- A triangle is `isosceles` when 2 of its sides are equal
- A triangle is `scalene` when none of its sides is equal to another side
- A triangle is `impossible` when the sum of two of its sides is strictly less than the third side
## Input
- **Line 1 to 3:** The length of each side of the triangle
## Examples
See the `test` folder for examples of input/output.