21150_Soundex

2022-5-16 18:18| 发布者: Hocassian| 查看: 33| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504932510500-Problem List-采集的数据-后羿采集器.html

Pro.ID

21150

Title

Soundex

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21150

AC

62

Submit

120

Ratio

51.67%

时间&空间限制

  • Time Limit: 600/300 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Soundex coding groups together words that appear to sound alike based on their spelling. For example, "can" and "khawn", "con" and "gone" would be equivalent under Soundex coding.

    Soundex coding involves translating each word into a series of digits in which each digit represents a letter:

          1 represents B, F, P, or V
         2 represents C, G, J, K, Q, S, X,  or Z
         3 represents D or T
         4 represents L
         5 represents M or N
         6 represents R

    The letters A, E, I, O, U, H, W, and Y are not represented in Soundex coding, and repeated letters with the same code digit are represented by a single instance of that digit. Words with the same Soundex coding are considered equivalent.

    输入

    Each line of input contains a single word, all upper case, less than 20 letters long.

    输出

    Description

    Soundex coding groups together words that appear to sound alike based on their spelling. For example, "can" and "khawn", "con" and "gone" would be equivalent under Soundex coding.

    Soundex coding involves translating each word into a series of digits in which each digit represents a letter:

          1 represents B, F, P, or V
         2 represents C, G, J, K, Q, S, X,  or Z
         3 represents D or T
         4 represents L
         5 represents M or N
         6 represents R

    The letters A, E, I, O, U, H, W, and Y are not represented in Soundex coding, and repeated letters with the same code digit are represented by a single instance of that digit. Words with the same Soundex coding are considered equivalent.

    Input
    Each line of input contains a single word, all upper case, less than 20 letters long.
    Output

    For each line of input, produce a line of output giving the Soundex code.

    Sample Input

    KHAWN
    PFISTER
    BOBBY

    Sample Output

    25
    1236
    11

    Source

    样例输入

    KHAWN
    PFISTER
    BOBBY

    样例输出

    25
    1236
    11

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部