main.cpp

来自「hanoi 是一个用递归算法计算“汉诺塔”的经典递归程序」· C++ 代码 · 共 25 行

CPP
25
字号
# include <iostream.h>
# include <conio.h>
# include "head.h"

//--------------------------------------------------------


void main()
{
  int num;
  char face=1;
  cout<<"Input the number of tower:";
  cin>>num;
  if (num>=1 && num<=45)
    move (num,1,2,3);
  else if (num>15 && num<=20)
         {
           cout<<"Please wait a moment..."<<endl;
           move (num,1,2,3);
         }
       else cout<<"Are you crazy ? "<<face<<endl<<endl;
  cout << "Press any key to exit ...";
  getch();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?