题目
代码
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{ //eof是-1,不能用char接收,选用int
int c, flag = 1;//设立标志位判断是左引号还是右
while (~(c = getchar()) ) {//EOF为-1,~后为0,退出循环
if (c == '"') {
printf("%s",(flag ? "``" : "' ' "));//用字符串输出新引号
flag = !flag;//标志位反转
}
else putchar(c);
}
}
疑问
代码没有ac,本地运行通过
来源:CSDN
作者:胡二多Hodor
链接:https://blog.csdn.net/JKbfm/article/details/104059064