ACM (TJU) : 2066


#include <stdio.h>
#include <string.h>

int main ()
{
    int dataSet;
    scanf ("%d", &dataSet);

    while ( dataSet-- ) {

        char a [110];
        char b [110];

        scanf ("%s %s", a, b);

        if ( strlen (a) < strlen (b) )
        printf ("NO BRAINS\n");

        else if ( strlen (a) > strlen (b) )
        printf ("MMM BRAINS\n");

        else {
            int diff = strcmp (a, b);

            if ( diff >= 0 )
            printf ("MMM BRAINS\n");

            else
            printf ("NO BRAINS\n");
        }

    }

    return  0;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s