QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 1024 MB مجموع النقاط: 33

#14002. 翻转单词

الإحصائيات

给定一个由空格分隔的单词列表,反转这些单词的顺序。每行文本包含 L 个字母和 W 个单词。一行将仅由字母和空格字符组成。每对相邻单词之间恰好有一个空格字符。

输入格式

输入的第一行给出测试用例的数量 N

接下来是 N 个测试用例。对于每个测试用例,将有一行由字母和空格字符组成的文本,表示一个由空格分隔的单词列表。空格不会出现在一行的开头或结尾。

输出格式

对于每个测试用例,输出一行,包含 "Case #x: ",后跟反转顺序后的单词列表。

数据范围

小数据规模(8 分)

  • N = 5
  • 1 ≤ L ≤ 25

大数据规模(25 分)

  • N = 100
  • 1 ≤ L ≤ 1000

样例

输入 1

3
this is a test
foobar
all your base

输出 1

Case #1: test a is this
Case #2: foobar
Case #3: base your all

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.