zoukankan      html  css  js  c++  java
  • Uva 12889 One-Two-Three

     

    Your little brother has just learnt to write one, two and three, in English. He has written a lot of those words in a paper, your task is to recognize them. Note that your little brother is only a child, so he may make small mistakes: for each word, there might be at most one wrong letter. The word length is always correct. It is guaranteed that each letter he wrote is in lower-case, and each word he wrote has a unique interpretation.

    Input 

    The first line contains the number of words that your little brother has written. Each of the following lines contains a single word with all letters in lower-case. The words satisfy the constraints above: at most one letter might be wrong, but the word length is always correct. There will be at most 10 words in 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
    
     1 #include<iostream>  
     2 #include<string.h>  
     3 #include<stdio.h>  
     4 #include<ctype.h>  
     5 #include<algorithm>  
     6 #include<stack>  
     7 #include<queue>  
     8 #include<set>  
     9 #include<math.h>  
    10 #include<vector>  
    11 #include<map>  
    12 #include<deque>  
    13 #include<list>  
    14 using namespace std;  
    15 int main()
    16 {
    17     int m;
    18     cin>>m;
    19     while(m--)
    20     {
    21     char s[10];
    22     cin>>s;
    23     int n=strlen(s);
    24     if(n==5)
    25     printf("3
    ");
    26     else if((s[0]=='o'&&s[1]=='n')||(s[1]=='n'&&s[2]=='e')||(s[0]=='o'&&s[2]=='e'))
    27     printf("1
    ");
    28     else
    29     printf("2
    ");
    30     }
    31     return 0;
    32 }
    View Code
  • 相关阅读:
    SpringBoot打jar包以及打成war包 (springboot2.0)
    学习软件开发的心得
    SQA计划
    继续冲吧
    别跑了,看看脚下有木有money
    springIOC的那些事
    ssm
    scrum 第二次冲刺
    云医院
    团队项目开发总结
  • 原文地址:https://www.cnblogs.com/qscqesze/p/3854227.html
Copyright © 2011-2022 走看看