c++汉诺塔

#include <bits/stdc++.h>
#include <conio.h>
#include <windows.h>
using namespace std;
const int COLUMN[4] = { 0, 2, 5, 8 };
const int DISC_CNT_MAX = 10;
const int ROW_OP_CNT = 2, COL_OP_CNT = 16;
const int ROW_MESSAGE = 3, COL_MESSAGE = 16;
const int ROW_HELP = 15, COL_HELP = 1;
const int ROW_MAX = 30, COL_MAX = 120;
const int BLUE = 1;
const int GREEN = 2;
const int CYAN = 3;
const int AQUA = 3;
const int RED = 4;
const int PURPLE = 5;
const int YELLOW = 6;
const int WHITE = 7;
int n;
stack<int> rod[4];
int sz[4] = { 0 };
int pos1, pos2;
int key;
bool prev_key_is_esc;
int op_cnt;
bool is_moving;
int moved_disc;
template <typename T>
inline T read() {
T x = 0;
T multiplier = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
    if (ch == '-') {
        multiplier = -1;
    }
    ch = getchar();
}
while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch & 15);
    ch = getchar();
}
return x * multiplier;
}
void set_caret_pos(int row = 1, int col = 1) {
COORD pos;
pos.X = col - 1;
pos.Y = row - 1;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
int get_caret_row() {
CONSOLE_SCREEN_BUFFER_INFO info;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info);
return info.dwCursorPosition.Y + 1;
}
int get_caret_col() {
CONSOLE_SCREEN_BUFFER_INFO info;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info);
return info
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值