跳马问题,帮忙调一下代码

[复制链接]
查看11 | 回复2 | 2011-5-13 17:57:38 | 显示全部楼层 |阅读模式
#include
#include
int x=11,z1=x*809+1,z2=x*8,z3=z1-z2*100,z4=z3-1;
void Horse(int a, int b, int t);
#include
using namespace std;
const int N = 10;
int a[N][N] = {0};
int cnt = 0;
void Horse(int a, int b, int t){

int x[4] ={-2, -1, 1, 2}, y[4] = {-2, -1, 1, 2};

if(t == N*N+1)

cnt++;

for(int i=0; i=0 && a+x=0 && b+y[j]<N && board[a+x][b+y[j]]==0){

a[a+x][b+y[j]] = t;

Horse(a+x, b+y[j], t+1);

a[a+x][b+y[j]] = 0;

}

}
}

回复

使用道具 举报

千问 | 2011-5-13 17:57:38 | 显示全部楼层
http://www.wutianqi.com/?p=1389怎么像是我写的?
回复

使用道具 举报

千问 | 2011-5-13 17:57:38 | 显示全部楼层
米弄过
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行