这个问题的思路应该从字符从字符的角度展开,不能一蹴而就。
int execise3()
{
int c; // the character currently input
while((c = getchar()) != '0')
{
if(c == '/t')
{
putchar('//');
putchar('t');
}
else if(c == '/b')
{
putchar('//');
putchar('b');
}
else if(c == '//')
{
putchar('//');
putchar('//');
}
else
putchar(c);
}
}
int main()
{
execise3();
return 0;
}