A

来源:互联网 发布:mac os 安装cocoapods 编辑:程序博客网 时间:2024/06/10 09:28
你弟弟刚刚学会写英语的一(one)、二(two)和三(three)。他在纸上写了好些一二三,可惜有些字母写错了。已知每个单词最多有一个字母写错了(单词长度肯定不会错),你能认出他写的啥吗?  

Input

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

Output

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

Sample Input
3owetootheee
Sample Output
123

Hint

水题,直接判断

#include<cstdio>#include<cstring>int main(){int n,k;char a[10];scanf("%d",&n);getchar();while(n--){scanf("%s",a);if(strlen(a)==5)printf("3\n");else{k=0;if(a[0]=='o')k++;if(a[1]=='n')k++;if(a[2]=='e')k++;if(k>1)printf("1\n");else printf("2\n");}}} 



原创粉丝点击