fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. void remove_substring(char *s, int p, int n) {
  5.  
  6. int i;
  7.  
  8. if(n == 0) {
  9. printf("%s", s);
  10. return;
  11. }
  12.  
  13. for (i = 0; i < p - 1; i++) {
  14. printf("%c", s[i]);
  15. }
  16.  
  17. for (i = p+n-1; i < strlen(s); i++) {
  18. printf("%c", s[i]);
  19. }
  20.  
  21.  
  22. }
  23.  
  24. int main(void) {
  25. remove_substring("abcdefghi",4,3);
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
abcghi