#include <stdio.h>
#include <string.h>
int main() {
char string[101];
printf("Forneca uma string com espacos em branco: "); fgets(string
, sizeof(string
), stdin
); for (int i = 0, posicao = 0; i < len; i++, posicao++) {
if (string[posicao] == ' ') {
posicao++;
}
string[i] = string[posicao];
}
printf("String sem espaços em branco: %s\n", string
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KaW50IG1haW4oKSB7CgljaGFyIHN0cmluZ1sxMDFdOwoJcHJpbnRmKCJGb3JuZWNhIHVtYSBzdHJpbmcgY29tIGVzcGFjb3MgZW0gYnJhbmNvOiAiKTsKCWZnZXRzKHN0cmluZywgc2l6ZW9mKHN0cmluZyksIHN0ZGluKTsKCWludCBsZW4gPSBzdHJsZW4oc3RyaW5nKTsKCXByaW50ZigiJXNcbiIsIHN0cmluZyk7Cglmb3IgKGludCBpID0gMCwgcG9zaWNhbyA9IDA7IGkgPCBsZW47IGkrKywgcG9zaWNhbysrKSB7CgkgICAgaWYgKHN0cmluZ1twb3NpY2FvXSA9PSAnICcpIHsKCSAgICAgICAgcG9zaWNhbysrOwoJICAgIH0KICAgICAgICBzdHJpbmdbaV0gPSBzdHJpbmdbcG9zaWNhb107Cgl9CglwcmludGYoIlN0cmluZyBzZW0gZXNwYcOnb3MgZW0gYnJhbmNvOiAlc1xuIiwgc3RyaW5nKTsKCXJldHVybiAwOwp9