汉诺塔游戏版本

 #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://ybzwz.com/article/pejdjs.html