#include"iostream.h"
void main()
{
int i,j,m,n,a[7][6];
cin>>m>>n;
int ctp(0,6,0,5);
}
int ctp(int hh,int he,int lh,int le);
int m,n,tw=0,a[7][6];
int ctp(int hh,int he,int lh,int le)
{
int j,i,tw;
cin>>i>>j;
if(i==m&&j==n)
{
cout<<i<<"行"<<j<<"列"<<endl;
//cout<<"提问了"<<tw<<"次"<<endl;
}
else
{
tw+=2;
if(i<=m)
{
if(j<=n)
ctp(hh,(hh+he)/2,lh,(lh+le)/2);
else
ctp(hh,(hh+he)/2,(lh+le)/2,le);
}
else
{
if(j<=n)
ctp((hh+he)/2,he,lh,(lh+le)/2);
else
ctp((hh+he)/2,he,(lh+le)/2,le);
}
}
}
c++ 太多初始化求解,
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-