35 lines
610 B
C++
35 lines
610 B
C++
|
#include "BST.hpp"
|
||
|
#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;
|
||
|
}
|