Pythagorean Triangle Validity — Can't solve it.

Revision en4, by Big_Integer, 2018-09-29 20:35:20

Hello, I have been trying to solve this problem for some time but getting WA.

The Problem This is a simple task for you.You have to write a simple code that can take three input a, b and c which are the length of the three sides of a Pythagorean triangle and check the triangle is valid or invalid.

The Input

The input file contains several lines. Each line contains three positive integers a, b, c < 100 which indicates the three sides of a triangle. Input is terminated by EOF.

The Output

For each input lines print a comment. Which contains if the triangle is right then “Valid.”, if the triangle is not right then “Invalid.” (Quote for clarification) in a separate line.

Sample Input

6 9 4 13 5 12

Sample Output

Invalid. Valid.

My code

But this approaches are not working out for me. I keep getting WA. I checked both of this code against this triplets and they checked out correctly.

original problem link : http://school.outsbook.com/problems/problemdetails/363

Please provide me some thoughts or error that is causing WA.

Thank you.

Tags triangle validity, pythagorean triples, #math, #geometry

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Big_Integer 2018-09-29 20:35:20 5 Tiny change: 'ides of a phythagorian triangl' -> 'ides of a Pythagorean triangl'
en3 English Big_Integer 2018-09-29 20:34:53 43
en2 English Big_Integer 2018-09-29 20:33:52 16 Tiny change: ' ![ ](http://s' -> ' ![Problem image](http://s'
en1 English Big_Integer 2018-09-29 20:32:44 3035 Initial revision (published)