- size_t len;
- char *buf = NULL;
- if (getline(&buf, &len, stdin) == -1)
- return 1;
- printf("%s", buf);
-
- while (*buf++ != '=');
-
- int x1 = strtol(buf, &buf, 10);
- buf+=strlen("..");
- int x2 = strtol(buf, &buf, 10);
- buf+=strlen(", y=");
- int y1 = strtol(buf, &buf, 10);
- buf+=strlen("..");
- int y2 = strtol(buf, &buf, 10);
-
- int maxy = 0;
+ int x1, x2, y1, y2, maxy = 0;
+ scanf("target area: x=%d..%d, y=%d..%d\n", &x1, &x2, &y1, &y2);