[BOJ 12606] Reverse Words (Large)
View as PDF
Submit solution
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text
Points:
1
Time limit:
5.0s
Memory limit:
512M
Problem types
Allowed languages
Given a list of space separated words, reverse the order of the words. Each line of text contains L letters and W words. A line will only consist of letters and space characters. There will be exactly one space character between each pair of consecutive words.
입력 형식
The first line of input gives the number of cases, N.
N test cases follow. For each test case there will a line of letters and space characters indicating a list of space separated words. Spaces will not appear at the start or end of a line.</p>
Limits
- N = 100
- 1 ≤ L ≤ 1000
For each test case, output one line containing "Case #x: " followed by the list of words in reverse order.
예제 입력
3
this is a test
foobar
all your base
예제 출력
Case #1: test a is this
Case #2: foobar
Case #3: base your all
Comments