Programming contests

ACM ICPC programozó csapatverseny, házi forduló, 2015. október 21.

October 21, 2015 10:00 AM – October 21, 2015 3:00 PM

Rotating Sentences

In this problem, you are asked to rotate a series of input lines 90 degrees clockwise. So, instead of displaying the input lines from left to right and top to bottom, your program will display them from top to bottom and right to left.

Input Specification

As input to your program, you will be given a maximum of 100 nonempty lines, each not exceeding 100 characters long. Legal characters include: newline, space, any punctuation characters, digits, and lowercase or uppercase English letters. (Note: Tabs are not legal characters.)

Output Specification

The output of the program should have the last input line printed out vertically in the leftmost column; the first line of the input would subsequently end up at the rightmost column. Note that spaces in the input must also appear in the output. Additional spaces are allowed, but only at the beginning or in the middle of output lines where it is necessary.

Sample Input

  1. Rene Decartes once said,
  2. "I think, therefore I am."
download as text file

Output for Sample Input

  1. "R
  2. Ie
  3.  n
  4. te
  5. iD
  6. ne
  7. kc
  8. ,a
  9.  r
  10. tt
  11. he
  12. es
  13. eo
  14. fn
  15. oc
  16. re
  17.  s
  18. Ia
  19.  i
  20. ad
  21. m,
  22. .
  23. "
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019