武汉科技大学ACM :1005: 一二三

Problem Description

 你弟弟刚刚学会写英语的一(one)、二(two)和三(three)。他在纸上写了好些一二三,可惜有些字母写错了。已知每个单词最多有一个字母写错了(单词长度肯定不会错),你能认出他写的啥吗?

Input

 第一行为单词的个数(不超过10)。以下每行为一个单词,单词长度正确,且最多有一个字母写错。所有字母都是小写的。

Output

 对于每组测试数据,输出一行,即该单词的阿拉伯数字。输入保证只有一种理解方式。

Sample Input

3
owe
too
theee

Sample Output

1
2
3
 1 #include <stdio.h>
 2 
 3 int main() 
 4 {
 5     int cases;
 6     while(scanf("%d", &cases)!=EOF)
 7     {
 8         while( cases-- )
 9         {
10             char a[10];
11             scanf("%s", a);
12             int i=0;
13             while(a[i]!='')
14             {
15                 i++;
16             }
17 
18             if( i > 3 ) puts("3");
19             else 
20             {
21                 if( ( a[0] == 'o' ) + ( a[1] == 'n' ) + ( a[2] == 'e' ) >= 2 ) 
22                     puts("1");
23                 else 
24                     puts("2");
25             }
26         }
27     }
28     
29     
30     return 0;
31 }


原文地址:https://www.cnblogs.com/liuwt365/p/4159533.html