triangle classification hair-splitting troubles

closed account (4ET0pfjN)
Hi, I need to write a program to test the triangle type:
to output either: scalene, isosceles, equilateral

My question is, (I know this is more math but I can't find answer anywhere)

is a valid scalene (3 unequal sides) when the largest side > the two smaller sides
or is it when the largest side < the two smaller sides, how do I know this for sure (w/o actually building a triangle)

Same goes for isosceles (2 sides same):
is a valid iscosceles when:
A) longest side > sum of two equal sides
==OR===
B) longest side < sum of two equal sides

Bear w/ me fellow programmers, thanks a bunch.

Cheers
Hmmm, ever tried to draw a triangle where the longest side is > sum of the two shortest? good luck with that

if(all sides the same length)
=> equilateral
else if(two sides the same length)
=> isosceles
else
=> scalene


longest side > sum of other two => not a triangle at all
Topic archived. No new replies allowed.