12289 - One-Two-Three
One-Two-Three |
Your little brother has just learnt to write one, two and three, in English. He has written a lot of thosewords in a paper, your task is to recognize them. Note that your little brother is only a child, so he maymake small mistakes: for each word, there might be at most one wrong letter. The word length isalways correct. It is guaranteed that each letter he wrote is in lower-case, and each word he wrote has aunique interpretation.
Input
The first line contains the number of words that your little brother has written. Each of the followinglines contains a single word with all letters in lower-case. The words satisfy the constraints above: atmost one letter might be wrong, but the word length is always correct. There will be at most 10 wordsin the input.
Output
For each test case, print the numerical value of the word.
Sample Input
3 owe too theee
Sample Output
1 2 3
#include<stdio.h> int main() { char s[6]; int t,i; scanf("%d",&t); while(t--) { scanf("%s",s); if(s[3]!='\0'){puts("3");continue;} if((s[0]=='o'&&s[1]=='n')||(s[0]=='o'&&s[2]=='e')||(s[2]=='e'&&s[1]=='n')) puts("1"); else puts("2"); } return 0; }