Advertisement
lil_kiddie

Untitled

Oct 9th, 2021
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. int main(int argc, char* argv[]) {
  6. char str[] = "end";
  7. for (int i = 0; i < argc; i++) {
  8. if (strstr(argv[i], str)) {
  9. printf("%s\n", argv[i]);
  10. }
  11. }
  12. for (int i = 0; i < argc; i++) {
  13. char* s = strstr(argv[i], str);
  14. if (s) {
  15. s += 3;
  16. s = strstr(s, str);
  17. if (s) {
  18. s += 3;
  19. printf("%s\n", s);
  20. }
  21. }
  22. }
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement