Project-Scylla/KNR Redux/ex1-9-2.c

23 lines
279 B
C
Raw Permalink Normal View History

#include <stdio.h>
#include <stdlib.h>
int main(){
int c = 0;
_Bool lastWS = 0;
while((c = getchar()) != EOF){
if(c == '\t' || c == ' '){
if(lastWS == 0){
lastWS = 1;
putchar(c);
}
}
else{
lastWS = 0;
putchar(c);
}
}
putchar('\n');
exit(0);
}