fork download
  1. #include<stdio.h>
  2.  
  3. int main() {
  4. char str[] = "Best language \"C\"";
  5.  
  6. for (int i = 0, d = 0; i < sizeof(str); i++)
  7. {
  8. if(str[i] == ' ' && d == 0)
  9. {
  10. d = i;
  11. }
  12.  
  13. if(d != 0 && str[i] != ' ' && d != i-1)
  14. {
  15. str[i-1] = '\n';
  16.  
  17. for (int j = 0; j < (i-1)-d; j++)
  18. {
  19. for (int thr = d; thr < sizeof(str) + 1; thr++)
  20. {
  21. str[thr] = str[thr+1];
  22. }
  23. }
  24. d = 0;
  25. }
  26. }
  27. printf("%s", str);
  28.  
  29. }
Success #stdin #stdout 0.01s 5296KB
stdin
Standard input is empty
stdout
Best
language
"C"