SHARE
TWEET

Untitled

a guest Oct 21st, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <ctype.h>
  3.  
  4. void Read()
  5. {
  6.     int c;
  7.     int need_space = 0;
  8.     while((c = getchar()) != EOF)
  9.     {
  10.         if(!isspace(c))
  11.         {
  12.             putchar(c);
  13.             need_space = 1;
  14.         }
  15.         if(isspace(c))
  16.         {
  17.             if(need_space)
  18.             {
  19.                 putchar(' ');
  20.                 need_space = 0;
  21.             }
  22.         }
  23.     }
  24. }
  25.  
  26. int main()
  27. {
  28.     Read();
  29.     return 0;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top