18. Is It a Triangle?
Foundation1000 ms256 MBSolved by 0%
Read three side lengths and print Yes if they can form a triangle,
or No if they cannot.
Three lengths form a triangle only when the sum of every pair is strictly greater than the third side. Equal is not enough, three sides of 1, 2 and 3 collapse into a straight line, not a triangle.
Constraints - `1 ≤ a, b, c ≤ 1000000000`
Input
A single line containing three integers, the side lengths, separated by spaces.
Output
Print exactly one word: Yes or No.
Input3 4 5
OutputYes
Noteis a right-angled triangle
Input1 2 3
OutputNo
Notehas two sides summing to exactly the third, which is a straight line rather than a triangle
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.