aboutsummaryrefslogblamecommitdiff
path: root/1.22.c
blob: 12d77846a94d55a51b62fbac57f1dee560d06891 (plain) (tree)






























                                      
#include <stdio.h>

#define LINE_LENGTH 230
#define TAB 8

int 
main(void)
{
  int count;
  char input;

  count = 0;
  
  while ((input = getchar()) != EOF) {
    if (input == '\n')
      count = 0;
    else if (input == '\t')
      count = count + TAB;
    else 
      count++;

    printf("%c", input);

    if (count >= LINE_LENGTH) {
      printf("\n");
      count = 0;
    }
  }

  return 0;
}