diff options
author | sinanmohd <pcmsinan@gmail.com> | 2022-06-04 12:11:15 +0530 |
---|---|---|
committer | sinanmohd <pcmsinan@gmail.com> | 2022-06-04 12:11:15 +0530 |
commit | c24973af02bc33f2f5f25d37e22ca91da5de3c47 (patch) | |
tree | 460a005b6a3a9a967bd881bc2bf01e0becbe33cc /1.21.c |
inital commit
Diffstat (limited to '1.21.c')
-rw-r--r-- | 1.21.c | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -0,0 +1,33 @@ +#include <stdio.h> + +#define TAB 8 + +int +main(void) +{ + int count, tab, blank; + char input; + + count = 0; + + while((input = getchar()) != EOF) { + + if (input == ' ') + count++; + + else { + + if (count > 0) { + for (tab = count/TAB; tab > 0; --tab) + printf("\t"); + for (blank = count%TAB; blank > 0; --blank) + printf(" "); + } + count = 0; + + printf("%c", input); + } + } + + return 0; +} |