Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int c, haveReplaced;
- while ((c = getchar()) != EOF) {
- printf("printing char %d\n", c);
- haveReplaced = 0;
- if (c == ' ') {
- if (haveReplaced == 0) {
- putchar(c);
- }
- haveReplaced = 1;
- } else {
- putchar(c);
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment