#include <stdio.h>
#include <stdlib.h>
#include "vec.cpp"
int main()
{
int flag = 0;
int temp[5];
srand(time(NULL));
int len;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf("%d", &len);
Vec v(len);
v.printall();
system("pause");
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
v.sort();
while (1)
printf("ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:1.<2E><><EFBFBD><EFBFBD> 2.ɾ<><C9BE> 3.ͳ<><CDB3>\n");
scanf("%d", &flag);
switch (flag)
case 1:
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ\n");
scanf("%d", &temp[0]);
(v.insert(v.search(temp[0]), temp[0]) != -1) ? (printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n")) : (printf("<EFBFBD><EFBFBD>Ԫ<EFBFBD>ػ<EFBFBD><EFBFBD><EFBFBD>Χ\n"));
break;
case 2:
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD>\n");
(v.remove_sorted(temp[0]) != -1) ? (printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n")) : (printf("<EFBFBD><EFBFBD>Ԫ<EFBFBD>ػ<EFBFBD><EFBFBD><EFBFBD>Χ\n"));
case 3:
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD>ֵ\n");
temp[1] = v.count(temp[0]);
(temp[1] != -1) ? (printf("һ<EFBFBD><EFBFBD>%d<><64>\n", temp[1])) : (printf("<EFBFBD><EFBFBD>Ԫ<EFBFBD>ػ<EFBFBD><EFBFBD><EFBFBD>Χ\n"));
default:
printf("<EFBFBD><EFBFBD><EFBFBD>ز˵<EFBFBD>\n");
}
flag = 0;
return 0;