方法有二: 1. 在 return 0 前加上 getch() ,则程序运行结束后,等待键入 “回车” 退出。 2. 写入头文件 #include <stdlib.h>; 然后在return 0 前加上 system("pause"); 来源:CSDN作者:永爱21g链接:https://blog.csdn.net/m0_46390616/article/details/104467105 标签 控制台