diff options
Diffstat (limited to 'three/expand.c')
-rw-r--r-- | three/expand.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/three/expand.c b/three/expand.c new file mode 100644 index 0000000..180cc98 --- /dev/null +++ b/three/expand.c @@ -0,0 +1,19 @@ +#include <stdio.h> + +int +main() +{ + int c, p; + while ((c = getchar()) != EOF) { + if (c == '-') { + c = getchar(); + for (++p; p < c + 1; ++p) { + putchar(p); + } + } else { + putchar(c); + } + p = c; + } + return 0; +} |