UVA 11479 Is this the easiest problem? Solution

UVA 11479 Is this the easiest problem?


#include<iostream>

using namespace std;

int main()
{
    long int test,a,b,c,count;
    cin>>test;
    count=1;
    while(count<=test)
    {
        cin>>a>>b>>c;
        cout<<"Case "<<count++<<": ";
        if(a+b>c && a+c>b && b+c>a)
        {
            if(a==b && b==c)
                cout<<"Equilateral"<<endl;
            else if(a==b || b==c || c==a)
                cout<<"Isosceles"<<endl;
            else
                cout<<"Scalene"<<endl;
        }
        else if(a<=0 || b<=0 || c<=0)
            cout<<"Invalid"<<endl;
        else
            cout<<"Invalid"<<endl;
    }
    return 0;
}



Comments

Popular posts from this blog

uva 679 - Dropping Balls Solution

uva 481 - What Goes Up Solution

uva-10077 Solution --- The Stern-Brocot Number System