Blob


1 /*
2 1-10. Write a program to copy its input to its output, replacing each tab by \t, each backspace by \b, and each backslash by \\. This makes tabs and backspaces visible in an unambiguous way.
3 */
5 #include <stdio.h>
7 main()
8 {
9 int c;
11 while ((c = getchar()) != EOF) {
12 if (c == '\t') {
13 printf("\\t");
14 } else if (c == '\b') {
15 printf("\\b");
16 } else if (c == '\\') {
17 printf("\\\\");
18 } else {
19 printf("%c", c);
20 }
21 }
22 }