diff --git a/ex3/ex3.cpp b/ex3/ex3.cpp index c7463ff..39fbeff 100644 --- a/ex3/ex3.cpp +++ b/ex3/ex3.cpp @@ -18,7 +18,7 @@ int main() v.printall(); while (1) { - printf("选择操作:1.插入 2.删除 3.统计\n"); + printf("选择操作:1.插入 2.删除 3.统计 4.退出\n"); scanf("%d", &flag); switch (flag) @@ -45,6 +45,9 @@ int main() (temp[1] != -1) ? (printf("一共%d个\n", temp[1])) : (printf("无此元素或超出范围\n")); break; + case 4: + return 0; + default: printf("返回菜单\n"); }