Pythagoras Rocks

Limits: 1s, 512 MB

Most of us were introduced with Pythagoras’s theorem back at the high school. It states a simple yet fascinating fact about right triangles. A right triangle is a triangle, in which one of the angles is 90 degrees. Pythagoras’s theorem says, for right triangle, the following formula holds:


This is a companion discussion topic for the original entry at https://toph.co/p/pythagoras-rocks

first of all I want to know why there is the hypotenuse of the triangle? and again we have to find hypotenuse of triangle by pythagoras formula? can’t I directly output the hypotenuse of triangle?

1 Like

The statement wasn’t originally very well written. This is a trivial problem.

I have tried to rewrite it a little to make it clearer what the goal of this problem is.

Well, the number among a,b,c which will be biggest will be the hypotenuse.right?
then why I am getting WA?

cin>>a>>b>>b;

This is your cin line. Can you spot the mistake?

Oh I have figured it out…Thanks

1 Like