fork download
  1. #include<stdio.h>
  2. #define NONBLANK '-'
  3.  
  4. int main(void)
  5. {
  6. int c,lastc;
  7.  
  8. lastc=NONBLANK;
  9.  
  10. while((c=getchar())!=EOF)
  11. {
  12. if(c==' ')
  13. {
  14. if(lastc!=' ')
  15. putchar(c);
  16. }
  17. else
  18. putchar(c);
  19.  
  20. lastc=c;
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 4396KB
stdin
Standard input is empty
stdout
Standard output is empty