Contact me:

tcpl 1-10

习题1-10

将输入中的符号替换为可见并输出

include <stdio.h>

/* Run this program on itself (this file) and the following string " "

  • will be only one blank long.
    */

main ()

{
int c;

while ((c = getchar()) != EOF) {

if (c == '\t')
printf("\t");
else if (c == '\b')
printf("\b");
else if (c == '\')
printf("\\");

else/避免重复输出/
putchar(c);

}
}

posted @ 2020-11-21 14:23  impwa  阅读(95)  评论(0)    收藏  举报