注:这道题的关键是1.使用标志变量
2.输入字符串的问题.
3.getchar()函数返回的是int类型.
#include<stdio.h>
main(){
int a , v=1;
while((a=getchar())!=EOF){
if(a == '"') { printf("%s", v ? "``" : "''");
v = !v;
}else{
printf("%c",a);
}
}
return 0;
}
注:这道题的关键是1.使用标志变量
2.输入字符串的问题.
3.getchar()函数返回的是int类型.
#include<stdio.h>
main(){
int a , v=1;
while((a=getchar())!=EOF){
if(a == '"') { printf("%s", v ? "``" : "''");
v = !v;
}else{
printf("%c",a);
}
}
return 0;
}