Guest User

Untitled

a guest
Jun 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int c, haveReplaced;
  5.  
  6. while ((c = getchar()) != EOF) {
  7. printf("printing char %d\n", c);
  8. haveReplaced = 0;
  9.  
  10. if (c == ' ') {
  11. if (haveReplaced == 0) {
  12. putchar(c);
  13. }
  14. haveReplaced = 1;
  15. } else {
  16. putchar(c);
  17. }
  18. }
  19.  
  20. return 0;
  21. }
Add Comment
Please, Sign In to add comment