P1427 Xiao Yu's Number Game
Description
Xiao Yu was recently asked to take part in a number game: it needs to remember a sequence of numbers $a_i$ (with arbitrary length, ending with $0$), then recite them in reverse order (do not recite the terminating $0$). This is really too hard for Xiao Yu's limited memory—you know, its whole head isn't that big, and part of it is delicious meat! So please help Xiao Yu by writing a program to solve this problem.
Input Format
A single line containing a sequence of integers, ending with $0$, separated by spaces.
Output Format
Output this sequence in reverse on a single line, separated by spaces.
Explanation/Hint
#### Constraints
For $100\%$ of the testdata, it is guaranteed that $0 \leq a_i \leq 2^{31} - 1$, and the number of integers does not exceed $100$.
Translated by ChatGPT 5