aboutsummaryrefslogtreecommitdiffstats
path: root/printparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'printparse.c')
-rw-r--r--printparse.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/printparse.c b/printparse.c
new file mode 100644
index 0000000..0966e61
--- /dev/null
+++ b/printparse.c
@@ -0,0 +1,21 @@
+#include<stdio.h>
+
+int main ( int argc, char *argv[] ) {
+ char c;
+ while ( (c = getchar()) != EOF ) {
+ switch (c) {
+ case '\n' :
+ printf("\\n");
+ break;
+ case '\t' :
+ printf("\\t");
+ break;
+ case '\\' :
+ printf("\\\\");
+ break;
+ default :
+ putchar(c);
+ break;
+ }
+ }
+}