Pythagoras Rocks

A Pythagorean triple consists of three positive integers a, b, and c, such that a2+b2=c2. The Pythag…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

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