11854 - Egypt
Determining if a triangle is a right triangle or not, lengths of the 3 sides of the triangle are given. Just implementation of Pythagorean theorem.
Pythagorean theorem states that the square of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the other two sides. The theorem can be written as an equation relating the lengths of the sides a, b and c, often called the "Pythagorean equation": a^2 + b^2 = c^2 , where c represents the length of the hypotenuse and a and b the lengths of the triangle's other two sides.
So, here a, b, c are given, just check if the value of a, b, c satisfies the Pythagorean theorem or not.
Simple 32-bit integer data type can be implemented as the input values are positive integers, less than 30000 .
The input values may not be in sorted order, so, any of the three values can be the length of the hypotenuse. So, check for all the three values.
Not necessary to use library function to calculate the square of any value, just simply multiply the value by itself.
6 8 10 25 52 60 5 12 13 0 0 0
right wrong right
References for Pythagorean theorem: http://en.wikipedia.org/wiki/Pythagorean_theorem