[UVA272] TeX 中的引号 TEX Quotes
题目描述
在 TeX 中,左双引号是两个反引号 ``,右双引号是两个单引号 ''。输入一篇包含双引号的文章,你的任务是把它转换成 TeX 的格式。
输入格式
输入包含多行文本(直至文件结束 EOF),文本中包含成对出现的英文双引号 "。
输出格式
输出转换后的文本:将第奇数个双引号替换为 ``,第偶数个双引号替换为 '',其余字符保持原样输出。
"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!"
``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!''
提示
《算法竞赛入门经典(第 2 版)》第 3 章 3.3 节字符数组 例题 3-1。