Guest User

Untitled

a guest
Apr 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. void ecritpremiersespaces(char chaine[], int m)
  2. {
  3. int lengh = strlen(chaine) + 1;
  4. char chaine2[lengh];
  5. char chainecont[m+1];
  6. int i;
  7.  
  8. for(i=0; i < m; i++)
  9. chainecont[i] = ' ';
  10. chainecont[m] = '\0';
  11.  
  12. enleverpremiersespaces(chaine);
  13. strcpy(chaine2, chaine);
  14. strcat(chaine, chainecont);
  15.  
  16. for(i=0; i <= lengh; i++)
  17. {
  18. chaine[i+m] = chaine2[i];
  19. if(i<m) chaine[i] = ' ';
  20.  
  21. }
  22. printf("%s", chaine);
  23.  
  24. }
Add Comment
Please, Sign In to add comment