시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 1024 MB | 0 | 0 | 0 | 0.000% |
Computers are great tools for storing, editing, and presenting textual information. When presenting text, one of the most important factors is where to place newlines. For this problem, you should write a program that re-formats text according to a simple set of rules and special markers in the source text.
The input is a sequence of tokens separated by whitespace (each separator is a single space or newline). All non-whitespace tokens are considered normal except for two special tokens: “N” and “END”. The “N” token indicates that a newline should be inserted into the text, and the “END” token indicates the end of input.
Print out each normal token followed by a space. For each occurrence of the special token “N”, print a newline.
A man provided with paper, N pencil, N and rubber, N and subject to strict discipline, N is in effect a universal machine. N N A. M. Turing N END
A man provided with paper, pencil, and rubber, and subject to strict discipline, is in effect a universal machine. A. M. Turing