Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <math.h>
  2. #include <stdio.h>
  3. #include <windows.h>
  4.  
  5. int main(int argc, char **argv)
  6. {
  7.  
  8. char *str = (char *)malloc(100);
  9. int repeat = 0;
  10.  
  11. char *line = GetCommandLineA();
  12.  
  13. while (*line != ' ')
  14. line++;
  15. line++;
  16.  
  17. if (strncmp(line, "repeat=", 7) == 0)
  18. {
  19. line += 7;
  20. repeat = atoi(line);
  21. line += (int)ceil(log10((double)repeat)) + 1;
  22. }
  23.  
  24. if (strncmp(line, "str=", 4) == 0)
  25. {
  26. line += 4;
  27. str = strtok(line, " ");
  28. }
  29.  
  30. for (int i = 0; i < repeat; i++)
  31. printf("%s\n", str);
  32.  
  33. line += strlen(str);
  34. for (; line >= GetCommandLineA(); line--)
  35. *line = '\x0';
  36.  
  37. free(str);
  38.  
  39. return -14;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement