UVa 12289 one-two-three (Water ver.)

Source: Internet
Author: User
Tags time limit

12289-one-two-three

Time limit:1.000 seconds

Http://uva.onlinejudge.org/index.php?option=onlinejudge&Itemid=99999999&category=244&page=show_ problem&problem=3710

Your little brother has just learnt to write one, two and three, in 中文版. He has written a lot of the those words in a paper, your task are to recognize them. Note This your little brother is only "a" child, "so he" make small mistakes:for all word, there might be at most one WR Ong letter. The word length is always correct. It is guaranteed which each letter he wrote was in lower-case, and all word he wrote has a unique interpretation.

Input

The contains the number of words that your little brother has. 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 as wrong, but the word length is always correct. There would be on most 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

This is still lrj out of the problem.

Complete code:

/*0.016s*/
  
#include <cstdio>
#include <cstring>
const char one[] = "one";
  
Char s[10];
  
int main ()
{
    int T, I, C;
    scanf ("%d\n", &t);
    while (t--)
    {
        gets (s);
        if (strlen (s) = = 5) puts ("3");
        else
        {
            c = 0;
            for (i = 0; i < 3; ++i) if (s[i] = = One[i]) ++c;
            Puts (C > 1?) "1": "2");
        }
    return 0;
}

Author: csdn Blog Synapse7

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.