//online parser:
https://www.bccn.net/run/
程序代码:
#include <stdio.h>
int main(int argc, char *argv[]);
void v_scanf(int *x, int *y)
{
static int idx;
if (x) *x = ((unsigned char *)main)[idx++] % 10;
if (y) *y = ((unsigned char *)main)[idx++] % 10;
#define OFF_X +50
if (!y) *x += OFF_X;
}
int main(int argc, char *argv[])
{
int px, py, ax, ay, bx, by, t;
#ifdef _OJ_
scanf("%d",&t);
#else
v_scanf(&t, NULL);
printf("t = %d\n", t);
#endif
for(int i = 0; i < t; i++) {
#ifdef _OJ_
scanf("%d%d",&px,&py);
#else
v_scanf(&px, &py);
printf("px = %d, py = %d\n", px, py);
#endif
#ifdef _OJ_
scanf("%d %d %d %d",&ax, &ay, &bx, &by);
#else
v_scanf(&ax, &ay);
v_scanf(&bx, &by);
printf("ax = %d, ay = %d\n", ax, ay);
printf("bx = %d, by = %d\n", bx, by);
#endif
if (px < ax || px > bx || py > by || py < ay)
puts("Outside");
else if((px < bx && px > ax) && (py > ay && py < by))
puts("Inside");
else
puts("On");
}
return 0;
}
output sample:
t = 55
px = 2, py = 7
ax = 9, ay = 2
bx = 1, by = 6
Outside
px = 4, py = 7
ax = 5, ay = 4
bx = 2, by = 7
Outside
px = 7, py = 2
ax = 0, ay = 2
bx = 9, by = 4
On
px = 7, py = 0
ax = 0, ay = 0
bx = 0, by = 2
Outside
px = 7, py = 9
ax = 8, ay = 9
bx = 2, by = 2
Outside
px = 1, py = 9
ax = 0, ay = 0
bx = 0, by = 0
Outside
px = 0, py = 0
ax = 2, ay = 7
bx = 9, by = 2
Outside
px = 2, py = 4
ax = 5, ay = 5
bx = 9, by = 9
Outside
px = 0, py = 7
ax = 8, ay = 1
bx = 4, by = 8
Outside
px = 4, py = 0
ax = 4, ay = 0
bx = 0, by = 0
Outside
px = 0, py = 2
ax = 4, ay = 3
bx = 5, by = 5
Outside
px = 9, py = 9
ax = 4, ay = 0
bx = 0, by = 0
Outside
px = 0, py = 3
ax = 4, ay = 0
bx = 0, by = 0
Outside
px = 2, py = 1
ax = 5, ay = 0
bx = 2, by = 1
Outside
px = 9, py = 6
ax = 2, ay = 7
bx = 4, by = 2
Outside
px = 7, py = 9
ax = 2, ay = 1
bx = 4, by = 5
Outside
px = 5, py = 9
ax = 5, ay = 0
bx = 9, by = 9
On
px = 6, py = 7
ax = 8, ay = 1
bx = 2, by = 8
Outside
px = 4, py = 0
ax = 4, ay = 0
bx = 0, by = 0
Outside
px = 0, py = 2
ax = 0, ay = 3
bx = 5, by = 5
Outside
px = 2, py = 1
ax = 5, ay = 8
bx = 2, by = 1
Outside
px = 9, py = 4
ax = 2, ay = 7
bx = 4, by = 2
Outside
px = 7, py = 9
ax = 2, ay = 9
bx = 4, by = 5
Outside
px = 5, py = 2
ax = 1, ay = 5
bx = 6, by = 2
Outside
px = 1, py = 9
ax = 2, ay = 2
bx = 7, by = 4
Outside
px = 2, py = 7
ax = 9, ay = 2
bx = 0, by = 4
Outside
px = 5, py = 5
ax = 9, ay = 5
bx = 8, by = 9
Outside
px = 9, py = 4
ax = 7, ay = 8
bx = 1, by = 0
Outside
px = 8, py = 4
ax = 0, ay = 4
bx = 0, by = 0
Outside
px = 0, py = 0
ax = 2, ay = 9
bx = 3, by = 5
Outside
px = 5, py = 9
ax = 5, ay = 6
bx = 9, by = 9
On
px = 2, py = 7
ax = 8, ay = 1
bx = 8, by = 8
Outside
px = 4, py = 0
ax = 4, ay = 0
bx = 0, by = 0
Outside
px = 0, py = 2
ax = 6, ay = 3
bx = 5, by = 5
Outside
px = 9, py = 5
ax = 6, ay = 9
bx = 9, by = 4
Outside
px = 7, py = 4
ax = 4, ay = 0
bx = 9, by = 5
Inside
px = 6, py = 9
ax = 9, ay = 2
bx = 7, by = 4
Outside
px = 7, py = 0
ax = 9, ay = 5
bx = 0, by = 9
Outside
px = 9, py = 6
ax = 7, ay = 4
bx = 7, by = 0
Outside
px = 9, py = 5
ax = 0, ay = 9
bx = 9, by = 8
Outside
px = 7, py = 4
ax = 5, ay = 2
bx = 1, by = 6
Outside
px = 8, py = 4
ax = 0, ay = 2
bx = 0, by = 2
Outside
px = 5, py = 5
ax = 5, ay = 2
bx = 9, by = 5
On
px = 6, py = 9
ax = 9, ay = 2
bx = 7, by = 4
Outside
px = 5, py = 2
ax = 9, ay = 5
bx = 6, by = 9
Outside
px = 9, py = 4
ax = 7, ay = 4
bx = 6, by = 2
Outside
px = 9, py = 5
ax = 0, ay = 9
bx = 9, by = 8
Outside
px = 7, py = 4
ax = 6, ay = 2
bx = 9, by = 5
Inside
px = 0, py = 9
ax = 9, ay = 6
bx = 7, by = 4
Outside
px = 5, py = 2
ax = 1, ay = 4
bx = 8, by = 4
Outside
px = 0, py = 2
ax = 8, ay = 2
bx = 5, by = 5
Outside
px = 5, py = 0
ax = 1, ay = 1
bx = 8, by = 4
Outside
px = 0, py = 2
ax = 6, ay = 2
bx = 5, by = 5
Outside
px = 1, py = 9
ax = 4, ay = 1
bx = 9, by = 9
Outside
px = 0, py = 7
ax = 9, ay = 4
bx = 5, by = 0
Outside