the-c-programming-language/chapter01/ex10.c (204B)
1 #include <stdio.h> 2 3 int main (void) 4 { 5 int c; 6 7 while((c = getchar()) != EOF) { 8 if(c == '\t') 9 printf("%s", "\\t"); 10 else if(c == '\\') 11 printf("%s", "\\\\"); 12 else 13 putchar(c); 14 } 15 return 0; 16 }