您的位置:首页 > 其它

TeX中的引号

2017-10-29 15:52 155 查看
Sample Input

"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!"

Sample Output

``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!''

#include<stdio.h>
int main()
{
int c,q=1;
while((c=getchar())!=EOF)
{
if(c=='"')
{
printf("%s", q?"``":"''");
q=!q;
}
else    printf("%c", c);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: