-
Notifications
You must be signed in to change notification settings - Fork 0
Printing 2n lines in reverse sequence
venuprasad naik edited this page Aug 14, 2017
·
1 revision
Write a program that reads 2n non-blank lines of input (terminated by a blank line), where n is a positive integer. The program should print the last n lines followed by the first n lines last. You can assume that each line is at most 100 characters long. The maximum value of n is not known.
Example input: Line 1 Line 2 ... Line 2n
Output: given lines of text reordered as follows. Line n+1 Line n+2 ... Line 2n Line 1 Line 2 ... Line n