题目链接:POJ 1573 Robot Motion
#include#include #include #include #include using namespace std; int n = 0,m = 0,st = 0; int map[10][20],dis[10][20];; bool vis[10][20]; int mv[4][2] = {{0,-1},{-1,0},{1,0},{0,1}}; void Xiao_MoNi(int w) { memset(vis,0,sizeof(vis)); int x = 0,y = w, x0 , y0; int step = 0; while(x>=0 && x =0 && y =0 && x =0 && y