Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- int main(int argc, char* argv[]) {
- char str[] = "end";
- for (int i = 0; i < argc; i++) {
- if (strstr(argv[i], str)) {
- printf("%s\n", argv[i]);
- }
- }
- for (int i = 0; i < argc; i++) {
- char* s = strstr(argv[i], str);
- if (s) {
- s += 3;
- s = strstr(s, str);
- if (s) {
- s += 3;
- printf("%s\n", s);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement