#include #define TABSTOP 8 /* number of columns between tab stops */ void putspace(int len); /* replace tabs with proper spaces */ int main() { int c; int col; int nspace; col = 0; while ((c = getchar()) != EOF) { if (c == '\t') { nspace = TABSTOP - (col % TABSTOP); col = col + nspace; putspace(nspace); } else if (c == '\n') { col = 0; putchar(c); } else { ++col; putchar(c); } } return 0; } /* print len spaces */ void putspace(int len) { int i; for (i = 0; i < len; ++i) putchar(' '); }