Reversing a list of words (6)

Write a program that reads a sequence of words and prints, in reverse order, the first half of the list.

Input

Input consists of a sequence of words.

Output

If nn denotes the total number of words, print the n/2\lfloor n/2 \rfloor first words of the original sequence, in reverse order, and one per line.

Observation

For the sake of practice, use recursion (not arrays).

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T12:19:30.474Z

© Jutge.org, 2006–2026.
https://jutge.org