UVa 272

From Algorithmist
Jump to navigation Jump to search

272 - TEX Quotes[edit]

Summary[edit]

This is a trivial String parsing problem.

Explanation[edit]

Use a flag to determine if we're at the first or the second quotes, and scan the string for double quotes, changing it to the desired quotes according to the flag.

Input[edit]

"To be or not to be," quoth the Bard, "that
is the question".
The programming contestant replied: "I must disagree.
To `C' or not to `C', that is The Question!"

Output[edit]

``To be or not to be,'' quoth the Bard, ``that
is the question''.
The programming contestant replied: ``I must disagree.
To `C' or not to `C', that is The Question!''