Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- char S[127];
- int i = 0;
- printf("input string:");
- gets(S);
- for(i; S[i] == ' ';++i)
- S[i] = S[i+1]
- for(i = 0; S[i] != '\0';++i)
- if((S[i] == ' ')&&(S[i+1]== ' ')||(S[i+1]== '\0'))
- S[i] = S[i+1];
- puts(S);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement