Another Anus


SUBMITTED BY: Guest

DATE: Oct. 25, 2014, 2:56 p.m.

FORMAT: C++

SIZE: 629 Bytes

HITS: 950

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. void what(char *string);
  5. void main()
  6. {
  7. char st[50] = "a3b4ccad3";
  8. what(st);
  9. puts(st);
  10. getch();
  11. }
  12. void what(char *string)
  13. {
  14. int i;
  15. char ch, *temp1, *temp2, arr[100];
  16. temp1 = string;
  17. temp2 = arr;
  18. while (*temp2++ = *temp1++)
  19. {
  20. if (*temp1 > '2' && *temp1 <= '9')
  21. {
  22. i = *temp1 - '0' - 1;
  23. puts(arr);
  24. for (ch = *(temp1-1); 1; temp2++, i--)
  25. *temp2 = ch;
  26. temp1++;
  27. }
  28. }
  29. strcpy(string, arr);
  30. }

comments powered by Disqus