1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <stdio.h> int main (int argc, char* argv[]) { char c; while ((c = getchar()) != EOF) { switch (c) { case '\n': puts("\\n"); break; case '\\': puts("\\\\"); break; default: printf("%c\n",c); break; } } return 0; }