QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 1024 MB Points totaux : 33

#14003. T9 拼写

Statistiques

拉丁字母包含 26 个字符,而电话键盘上只有 10 个数字。我们希望通过使用一系列按键来表示所需的字符,从而更轻松地给朋友写短信。字母与数字的映射关系如下图所示。例如,要输入字符 B,程序需要按 22。为了连续输入来自同一个按键的两个字符,用户必须在第二次按键前暂停。应输出空格字符 ' ' 来表示暂停。例如,2 2 表示 AA,而 22 表示 B

输入格式

输入的第一行给出测试用例的数量 N。接下来是 N 个测试用例。每个测试用例是一行文本,格式为:

desired_message

每个消息将仅由小写字符 a-z 和空格字符 ' ' 组成。按数字 0 会产生一个空格。

输出格式

对于每个测试用例,输出一行,包含 "Case #x: ",后跟翻译成按键序列的消息。

数据范围

小数据规模(8 分)

  • 1 ≤ N ≤ 100。
  • 1 ≤ 消息的字符长度 ≤ 15。

大数据规模(25 分)

  • 1 ≤ N ≤ 100。
  • 1 ≤ 消息的字符长度 ≤ 1000。

样例

输入样例 1

4
hi
yes
foo  bar
hello world

输出样例 1

Case #1: 44 444
Case #2: 999337777
Case #3: 333666 6660 022 2777
Case #4: 4433555 555666096667775553

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.