The question is this: Make a program that reads a text (string) typed by the user with a maximum of 500 characters. Print this text by replacing the first letter of each word with an asterisk '*'.
Read the 500 characters I was able to do:
printf("Digite uma palavra (tamanho maximo de 500 letras):");
gets(palavra);
I'm having trouble figuring out what to do. I need to palavra[i]!='
for
'
If using %code% would it look something like this?
for (i=0; palavra[i]!='printf("Digite uma palavra (tamanho maximo de 500 letras):");
gets(palavra);
' ; i++ )
{
for (i=0 ; palavra[i]<'for (i=0; palavra[i]!='%pre%' ; i++ )
{
for (i=0 ; palavra[i]<'%pre%'; i++ )
{
while (palavra[i]==palavra[i+1])
{
palavra[i]=' ';
achou=1;
printf ("%c\n\n", palavra[i]);
i++;
}
}
}
'; i++ )
{
while (palavra[i]==palavra[i+1])
{
palavra[i]=' ';
achou=1;
printf ("%c\n\n", palavra[i]);
i++;
}
}
}