12289 - One-Two-Three
2013-06-14 22:00
281 查看
One-Two-Three |
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 lengthis 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; }
相关文章推荐
- UVA OJ 12289 One-Two-Three
- UVa 12289 One-Two-Three (water ver.)
- [解题报告]12289 - One-Two-Three
- 12289 - One-Two-Three
- UVa 12289 - One-Two-Three
- UVa 12289 - One-Two-Three
- [结题报告]12289 - One-Two-Three Time limit: 1.000 seconds
- UVA 12289 One-Two-Three
- 奥运英语[9]数字:1,2,3……10 Numbers: one, two, three...ten.
- ChargeSystem——One,Two,Three
- Uva 12889 One-Two-Three
- Project Euler17.数字1,2,3使用英文的表示为one,two,three,使用的英文的字母数的总和为3+3+5=11,现有1到1000,使用的英文字母数总和为多少?(空格和连接符不计)
- queue by one stack、two stack and three stack
- ASP杂谈ONE、TWO、THREE
- It's as simple as one,two ,three…
- 如何实现将'one,two,three,four,five' 分别打印
- One-Two-Three
- one two three zero six
- ChargeSystem——One,Two,Three
- test one two three