汉诺塔游戏版本

 #include
using namespace std;
int A[4][7]={{0},{4,11,3,2,1,0,0},{1,11,0,0,0,0,0},{1,11,0,0,0,0,0}};
void show()
{
//for(int i=1;i<=3;i++){ for(int j=0;j<7;j++)  cout<0;i--)
  {
   for(int j=1;j<4;j++)  
      {
         if(A[j][i]==0)cout<<"                           ";
         if(A[j][i]==1)cout<<"            [1]            ";
         if(A[j][i]==2)cout<<"          [  2  ]          ";
         if(A[j][i]==3)cout<<"         [   3   ]         ";
         if(A[j][i]==4)cout<<"        [    4    ]        ";
         if(A[j][i]==5)cout<<"       [     5     ]       ";
        if(A[j][i]==11)cout<<"[-------------------------]";           
      }
   cout<>m>>n;
if(m==n)play();
if(1>m||m>3||1>n||n>3)play();
if(A[m][A[m][0]]            
            
                            
本文题目:汉诺塔游戏版本
浏览路径:http://hbruida.cn/article/pejdjs.html