题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=208
题目大意:输入的句子包含以"开头和结尾的句子,请把它们替换成以``开头,以''结尾
#include<stdio.h>
#include<string.h>
int main()
{
int c ,q = 1;//q判断"是 开头还是结尾,1为开头,0为结尾
while((c=getchar())!=EOF){//循环读取文本内容
if(c == '"' && q){
printf("``"); q=0;
}
else if(c == '"' && !q) printf("''");
else printf("%c",c);
}
return 0;
}