0
Can you give me the key to solve this:
you will be given three values a,b,c lengths of the sides of a triangle -->>> you should output if they can built a triangle or not //B-)
2 odpowiedzi
+ 1
Read this:
https://en.wikipedia.org/wiki/Triangle_inequality
The triangle inequality theorem states that the sum of the side lengths of any 2 sides of a triangle must exceed the length of the third side.
int a = 15, b = 36, c = 50;
std::cout << std::boolalpha
<< (a + b > c &&
a + c > b &&
b + c > a)
<< std::endl;
0
👍👍👍very nice thx