38 lines
394 B
C
38 lines
394 B
C
#include <stdio.h>
|
|
|
|
#define PRINT 0
|
|
#define SKIP 1
|
|
|
|
// printing control chars
|
|
|
|
main()
|
|
{
|
|
int c;
|
|
int state;
|
|
|
|
while ((c = getchar()) != EOF)
|
|
{
|
|
state = PRINT;
|
|
if (c == '\t')
|
|
{
|
|
state = SKIP;
|
|
printf("\\t");
|
|
}
|
|
if (c == '\\')
|
|
{
|
|
state = SKIP;
|
|
printf("\\\\");
|
|
}
|
|
if (c == '\b')
|
|
{
|
|
state = SKIP;
|
|
printf("\\b");
|
|
}
|
|
|
|
if (state == PRINT)
|
|
{
|
|
putchar(c);
|
|
}
|
|
}
|
|
}
|