• 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
  • 相关阅读:
    centos7下如何使用udev配置asm磁盘
    ORA-29786: SIHA attribute GET failed with error [Attribute 'SPFILE' sts[200]
    安装grid时报INS-40404错误
    clickhouse编译安装
    centos7通过rc.local文件添加自启动服务
    Error in invoking target 'agent nmhs' of makefile
    打补丁(18370031)
    2020 HFCTF
    2020省赛决赛
    2020西湖论剑
  • 原文地址:https://www.cnblogs.com/qscqesze/p/3854227.html
Copyright © 2020-2023  润新知