fork download
  1. #include <stdio.h>
  2. #define MAX 500
  3.  
  4. int main() {
  5. char text [MAX + 1];
  6. printf("Informe o texto (tamanho maximo %d caracteres:", MAX);
  7. fgets(text, sizeof(text), stdin);
  8. text[0] = '*';
  9. for (int i = 0; i <= MAX; i++) if (text[i] == ' ') text[i + 1] = '*';
  10. printf("\nO texto final e %s\n", text);
  11. }
  12.  
  13. //https://pt.stackoverflow.com/q/88015/101
Success #stdin #stdout 0s 4384KB
stdin
teste teste teste
stdout
Informe o texto (tamanho maximo 500 caracteres:
O texto final e *este *este *este