n=int(input())
for i in range(1,n+1):
s = input()
print("Case #%d: "%(i),end='')
print(*s.split()[::-1])
https://www.acmicpc.net/problem/12606
12606번: Reverse Words (Large)
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 consecutiv
www.acmicpc.net
문자열 쪼개고 거꾸로 출력하면됩니다!
Split the String and print reversely Using '*', [::-1]
반응형
'python-algorithm' 카테고리의 다른 글
백준 2526 싸이클 (0) | 2022.10.31 |
---|---|
백준 25314 코딩은 체육과목 입니다 (0) | 2022.10.30 |
백준 13322 접두사 배열 (0) | 2022.10.29 |
백준 9455 박스 (0) | 2022.10.29 |
백준 2456 나는 학급회장이다 (0) | 2022.10.29 |
댓글