Created
April 21, 2017 10:39
-
-
Save Todai88/b4135d06fc3531753288ba582f8d1275 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
int main () { | |
// ### Setting up the variables | |
char input [100], blank[100]; | |
fgets(input, 100, stdin); | |
int i = 0, k = 0; | |
// ### Looping over the array | |
while (input[i] != '\0') { | |
if (input[i] == ' ') { | |
int j = i + 1; | |
if (input[j] != '\0') { | |
while (input[j] != '\0' && input[j] == ' ') { | |
if (input[j] == ' ') { | |
i++; | |
} | |
j++; | |
} | |
} | |
} | |
blank[k] = input[i]; | |
i++; | |
k++; | |
} | |
printf("%s", blank); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment