Advertisement
noshin98

uva 12289

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