UVa 11479 Is this the easiest problem?

Code:
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<map>
#include<vector>
using namespace std;
typedef pair<char,int> ci;
bool check(long long int a,long long int b,long long int c)
{
    long long int k1=a+b,k2=a+c,k3=b+c;
    if(a!=0&&b!=0&&c!=0&&k1>c&&k2>b&&k3>a)
    return true;
    else return false;
}
int main()
{
    int cas;
    cin>>cas;
    for(int cc=1;cc<=cas;cc++)
    {
        long long int a,b,c;
        cin>>a>>b>>c;

        if(check(a,b,c))
        {
            if(a==b && b==c) printf("Case %d: Equilateral\n",cc);
            else if(a==b || a==c || b==c) printf("Case %d: Isosceles\n",cc);
            else printf("Case %d: Scalene\n",cc);
        }
        else printf("Case %d: Invalid\n",cc);

    }
    return 0;

}

留言

這個網誌中的熱門文章

Things a Little Bird Told Me: Confessions of the Creative Mind

UVa 12970 Alcoholic Pilots

UVa 483 Word Scramble