让c++程序暂停的方法有哪些?

1.程序末尾即return 0;前,加 while(1);
2.程序末尾即return 0;前,加 scanf("/n");(需加头文件<cstdio>)
3.程序末尾即return 0;前或者需暂停处,加 system(“pause”);(需加头文件#include<iostream>)(推荐,即你想要的“按任意键继续”)

原文地址:https://www.cnblogs.com/cpprun/p/2660774.html