Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Collapse spaces
- #include <stdio.h>
- #include <ctype.h>
- int main()
- {
- int c;
- while((c=getchar())!=EOF)
- {
- if(c==' ')
- {
- while(isspace(c=getchar()));
- if(c!='\n')
- putchar(' ');
- putchar(c);
- }
- else
- putchar(c);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement