#include <stdio.h>
#include <stdlib.h>
#include<math.h>
int main(int argc, char *argv[])
{
int t, x, y, king, queen, car, elg;
char begin[6],end[6];
scanf("%d",&t);
while(t--)
{
scanf("%s %s",begin,end);
x = abs(begin[0]-end[0]);
y = abs(begin[1]-end[1]);
if( x==0 && y==0 )
{
printf("0 0 0 0\n");
}
else
{
if( x<y )
printf("%d ",y);
else printf("%d ",x);
if( x==0 || y==0 || x==y )
printf("1 ");
else printf("2 ");
if( x==0 || y==0 )
printf("1 ");
else printf("2 ");
if( abs(x-y)%2!=0 )
printf("Inf\n");
else if( x==y )
printf("1\n");
else printf("2\n");
}
}
system("PAUSE");
return 0;
}
Q1:几种情况要考虑周全,比如在原位置不动的情况下;
Q2:象的走法相对复杂,横纵坐标之差的奇偶性无论如何,象的行走都保持不变;