Advertisement
juanjo12x

UVA_12289_One_Two_Three

May 26th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main ()
  5. {
  6.     int testCase; scanf ("%d", &testCase);
  7.  
  8.     while ( testCase-- )
  9.     {
  10.         char a [10]; scanf ("%s", a);
  11.  
  12.         if ( strlen (a) == 5 ) printf ("3\n");
  13.         else
  14.         {
  15.             int cnt = 0;
  16.  
  17.             if ( a [0] == 'o' ) cnt++;
  18.             if ( a [1] == 'n' ) cnt++;
  19.             if ( a [2] == 'e' ) cnt++;
  20.  
  21.             if ( cnt >= 2 ) printf ("1\n");
  22.             else printf ("2\n");
  23.         }
  24.     }
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement