From c248c9a5b20926fff1654983059166193757325b Mon Sep 17 00:00:00 2001 From: celso Date: Sat, 5 Nov 2022 17:52:17 -0300 Subject: [PATCH] tenth exercise --- 1-10.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 1-10.c diff --git a/1-10.c b/1-10.c new file mode 100644 index 0000000..43cc196 --- /dev/null +++ b/1-10.c @@ -0,0 +1,23 @@ +#include +int main() { + int c; + while ((c=getchar()) != EOF){ + if (c == '\t'){ + putchar('\\'); + putchar('t'); + continue; + } + if (c == '\b'){ + putchar('\\'); + putchar('b'); + continue; + } + if (c == '\\'){ + putchar('\\'); + putchar('\\'); + continue; + } + putchar(c); + } + return 0; +}