This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/ex10/ex10.cpp

35 lines
617 B
C++
Raw Normal View History

2021-12-17 08:38:06 +00:00
#include "../ex9/BST.hpp"
2021-12-03 07:26:29 +00:00
#include <iostream>
int main()
{
printf("初始化\n");
BST *b = new BST(31);
printf("层次");
b->trav_level();
// printf("\n高为%d\n", b->height());
restart:
printf("是否重新生成0/1\n");
int op = 2;
scanf("%d", &op);
if (op == 1)
{
delete b;
b = new BST(31);
printf("层次");
b->trav_level();
goto restart;
}
while (1)
{
printf("输入需要寻找的时间:");
int h = 0, m = 0;
scanf("%d:%d", &h,&m);
b->search_best(60 * h + m);
}
return 0;
}