#include <stdio.h>
int main(void){
int c, blank_recieved = 0;
printf("Input some characters, when you finishes, press Ctrl+D./n");
while ((c = getchar()) != EOF){
if (c == ' ') {
if (!blank_recieved) {
blank_recieved = 1;
putchar(c);
}
} else {
blank_recieved = 0;
putchar(c);
}
}
return 0;
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266655.html