ninth exercise

This commit is contained in:
celso 2022-11-05 17:52:07 -03:00
parent a1dbca90e4
commit 4b6ce825b8
1 changed files with 19 additions and 0 deletions

19
1-9.c Normal file
View File

@ -0,0 +1,19 @@
#include <stdio.h>
int main() {
int c;
int prevb = 0;
while ((c=getchar()) != EOF){
if (c == ' ' && prevb == 1){
continue;
}
if (c == ' '){
prevb = 1;
putchar(c);
}
else{
prevb = 0;
putchar(c);
}
}
return 0;
}