fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. int main(void) {
  6. char *query = "-id=103&-id=101&-id=102&-act=Delete";
  7. char *ptr = strstr(query, "-id=");
  8. if (ptr) {
  9. ptr += 4;
  10. int n = atoi(ptr);
  11. printf("%d\n", n);
  12. for (;;) {
  13. ptr = strstr(ptr, "&-id=");
  14. if (!ptr) break;
  15. ptr += 5;
  16. int n = atoi(ptr);
  17. printf("%d\n", n);
  18. }
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
103
101
102