[Cpp] // time. cpp: Defines the entry point for the console application. // # include "stdafx. h "# include <iostream> # include <string> # include <Windows. h ># include <list> using namespace std; int box [8] [10] =,, }}; struct s Point {sPoint (int x1, int y1) {x = x1; y = y1;} int x; int y ;}; void calc (int * box, int width, int height, sPoint start, sPoint end) {list <sPoint> s; box [start. x * width + start. y] = 2; int x = start. x, y = start. y; s. push_back (sPoint (x, y); while (1) {if (x = end. x & y = end. y) {while (! S. empty () {cout <s. front (). x <"" <s. front (). y <endl; s. pop_front ();} break;} else {// cout <x <"" <y <endl;} bool bGo = false; for (int I = 0; I <8; I ++) {switch (I) {case 0: {if (y> 0 & box [(Y-1) * width + x] = 0) {y = Y-1; box [y * width + x] = 2; s. push_back (sPoint (x, y); bGo = true;} break;} case 1: {if (x <width-1 & y> 0 & box [(Y-1) * width + x + 1] = 0) {x = x + 1; y = Y-1; box [y * width + x] = 2; s. push_back (sPoint (x, y )); BGo = true;} break;} case 2: {if (x <width-1 & box [y * width + x + 1] = 0) {x = x + 1; box [y * width + x] = 2; s. push_back (sPoint (x, y); bGo = true;} break;} case 3: {if (x <width-1 & y