// 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 spoint {spoint (INT X1, in T 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 <widt The H-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