Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 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;
  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 = line;
  28. while(*str == ' ')str++;
  29. }
  30.  
  31. for (int i = 0; i < repeat; i++)
  32. printf("%s\n", str);
  33.  
  34. line += strlen(str);
  35. for (; line >= GetCommandLineA(); line--)
  36. *line = '\x0';
  37.  
  38. return -14;
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement