Problem Description Link
Algorithm:
This is a geometric problem . you can solve this problem easily . you can
follow this stapes
1.
At first you need three value for three sides
(ie. a, b, c)
N.B.: three sides can formed a triangle if
and only if third side is greater than summation of
other two side . where third side is largest value among
three sides value .
(i.e.: 5, 9, 6 where
third side is 9).
2. if
possible formed a triangle then you need to check
· Equilateral - All three sides of valid
triangle are equal
· Isosceles - Exactly two of the sides of
a valid triangle are equal.
·
Scalene - No pair of sides are equal in a valid triangle.
3. Otherwise
·
Invalid - The three sides can not form a triangle
(N.B: you can use long long int for data
type)
No comments:
Post a Comment
Write your comment - Share Knowledge and Experience