UVa : 12289 (One-Two-Three)



// http://uva.onlinejudge.org/external/122/12289.html
// Tag: Adhoc
// Runtime: 0.012s

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

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

    while ( testCase-- )
    {
        char a [10]; scanf ("%s", a);

        if ( strlen (a) == 5 ) printf ("3\n");
        else
        {
            int cnt = 0;

            if ( a [0] == 'o' ) cnt++;
            if ( a [1] == 'n' ) cnt++;
            if ( a [2] == 'e' ) cnt++;

            if ( cnt >= 2 ) printf ("1\n");
            else printf ("2\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