Created
November 30, 2014 03:08
-
-
Save anonymous/17ecf9ecb4ad9df10e5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*print a single blank for any number of blanks*/ | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <ctype.h> | |
int main() | |
{ | |
int c = getchar(); | |
while (c != EOF) { | |
if (isblank(c)) { | |
while (c == ' ') { | |
c = getchar(); | |
} | |
putchar(' '); | |
} else { | |
putchar(c); | |
c = getchar(); | |
} | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment