21346_NumericallySpeaking

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

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

Pro.ID

21346

Title

Numerically Speaking

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 900/300 MS (Java/Others)     Memory Limit: 20000/10000 K (Java/Others)
  • 描述

    A developer of crossword puzzles (and other similar word games) has decided to develop a mapping between every possible word with from one to twenty characters and unique integers. The mapping is very simple, with the ordering being done first by the length of the word, and then alphabetically. Part of the list is shown below.

        a          1
        b          2
        ...
        z          26
        aa         27
        ab         28
        ...
        snowfall   157,118,051,752
        ...


    Your job in this problem is to develop a program which can translate, bidirectionally, between the unique word numbers and the corresponding words.

    输入

    Input to the program is a list of words and numbers, one per line starting in column one, followed by a line containing a single asterisk in column one. A number will consist only of decimal digits (0 through 9) followed immediately by the end of line (that is, there will be no commas in input numbers). A word will consist of between one and twenty lowercase alphabetic characters (a through z).

    输出

    Description

    A developer of crossword puzzles (and other similar word games) has decided to develop a mapping between every possible word with from one to twenty characters and unique integers. The mapping is very simple, with the ordering being done first by the length of the word, and then alphabetically. Part of the list is shown below.

        a          1
        b          2
        ...
        z          26
        aa         27
        ab         28
        ...
        snowfall   157,118,051,752
        ...


    Your job in this problem is to develop a program which can translate, bidirectionally, between the unique word numbers and the corresponding words.

    Input
    Input to the program is a list of words and numbers, one per line starting in column one, followed by a line containing a single asterisk in column one. A number will consist only of decimal digits (0 through 9) followed immediately by the end of line (that is, there will be no commas in input numbers). A word will consist of between one and twenty lowercase alphabetic characters (a through z).
    Output
    The output is to contain a single line for each word or number in the input data. This line is to contain the word starting in column one, followed by an appropriate number of blanks, and the corresponding word number starting in column 23. Word numbers that have more than three digits must be separated by commas at thousands, millions, and so forth.
    Sample Input
    29697684282993
    transcendental
    28011622636823854456520
    computationally
    zzzzzzzzzzzzzzzzzzzz
    *
    Sample Output
    elementary            29,697,684,282,993
    transcendental        51,346,529,199,396,181,750
    prestidigitation      28,011,622,636,823,854,456,520
    computationally       232,049,592,627,851,629,097
    zzzzzzzzzzzzzzzzzzzz  20,725,274,851,017,785,518,433,805,270
    Source

    样例输入

    29697684282993
    transcendental
    28011622636823854456520
    computationally
    zzzzzzzzzzzzzzzzzzzz
    *

    样例输出

    elementary            29,697,684,282,993
    transcendental        51,346,529,199,396,181,750
    prestidigitation      28,011,622,636,823,854,456,520
    computationally       232,049,592,627,851,629,097
    zzzzzzzzzzzzzzzzzzzz  20,725,274,851,017,785,518,433,805,270

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部