实例说明:
输入要求:
输入样例:
2
a1 c3
f5 f8
输出样例:
2 1 2 1
3 1 1 Inf
程序代码:
#include <iostream>
#include <cmath>
using namespace std;
int Wang(int x,int y) //王走的最少步数
{
if(x<y) //x=y时,走的最小步数=x;
cout<<y<<" ";
else
cout<<x<<" ";
}
int Hou(int x,int y) //后的最少步数(后不限格数)
{
if(x==y||x==0||y==0)
cout<<"1"<<" ";
else
cout<<"2"<<" ";
}
int Ju(int x,int y) //车的最少步数
{
if(x==0||y==0)
cout<<"1"<<" ";
else
cou