···
include<iostream>
using namespace std;
int main()
{
int nCases, i;
cin>>nCases;
for (i = 0; i < nCases; i++)
{
char begin[5], end[5];
cin >> begin >> end;
int x, y;
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)
{
cout << y << " ";
}
else
{
cout << x << " ";
}
if (x ==y||x==0||y==0)
{
cout << "1 ";
}
else
{
cout << "2 ";
}
if (x == 0 || y == 0)
{
cout << "1 ";
}
else
{
cout << "2 ";
}
if (abs(x-y)%2!=0)
{
cout<<"Inf\n";
}
else
{
if (x == y)
cout<<"1\n";
else
cout<<"2\n";
}
}
}
system("pause");
}
···
查了挺久的错,结果是Inf的大写忘了
qwq