answer,Iamsorry."<<endl;Рflag=0;Рbreak;Р}Р)Р)РInit_diamond();Рanswer<<"Theinitializationdiamondstates:"<<endl;Рfor(inti=0;i<7;i++)Р{Рfor(intj=0;j<7;j++)Р{answer<<diamond[i][j]<<'';}answer<<endl;Р}Рanswer<<endl<<endl;for(intn=0;n<top;n++)//输出解Р{Рanswer<<"step"<<n+1<<":Movediamond("<<mystack[n].sy+1<<〞,"<<mystack[n].sx+1<<")Р--->("<<mystack[n].ty+1<<","<<mystack[n].tx+1<<")"<<endl;Рdiamond[mystack[n].sy][mystack[n].sx]='.';Рdiamond[(mystack[n].sy+mystack[n].ty)/2][(mystack[n].sx+mystack[n].tx)/2]='.';Рdiamond[mystack[n].ty][mystack[n].tx]='*';Рanswer<<"Leftdiamonds:"<<top-n<<endl;Рfor(intk=0;k<7;k++)Р{Рfor(intj=0;j<7;j++)Р{answer<<diamond[k][j]<<'';}answer<<endl;Р}Рanswer<<endl<<endl;Р}Рif(flag)Р{Рcout<<"Theanswerhasbeenexportedtofile\"answer.txt\"inthesamedirectory.Welcometosee!"<<endl;Р}Р}