Advertisement
Yanina_Natalya

Untitled

Mar 26th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #define TRUE 1
  3. #define FALSE 0
  4. int main() {
  5.   char c;
  6.   int t;
  7.   t = FALSE;
  8.   while ((c = getchar()) != EOF) {
  9.     if(c == ' ' || c == '\t'){
  10.       if( t == TRUE) printf("\n");
  11.       t=FALSE;
  12.     }
  13.     else if (c != '\n'){
  14.       t = TRUE;
  15.       putchar(c);
  16.     }
  17.     else { if(t != FALSE) {
  18.       printf("\n");
  19.       t = FALSE;
  20.     }
  21.     }
  22.   }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement