Monday, April 25, 2016

UVA 11455. : Behold my quadrangle -Solution

Unknown
#include<cstdio>
#include<algorithm>
using namespace std;

int main()
{
    int t;
    scanf("%d",&t);
    while (t--)
    {
        unsigned long long int s[4];
        for (int i=0;i<4;i++) scanf("%llu",&s[i]);
        sort(s,s+4);
        if (s[0]==s[1]&&s[1]==s[2]&&s[2]==s[3])
            printf("square\n");
        else if (s[0]==s[1] && s[2]==s[3])
            printf("rectangle\n");      
        else if (s[0]+s[1]+s[2]>=s[3])
            printf("quadrangle\n");
        else printf("banana\n");
    }
    return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,