关于《C++程序设计原理与实践》第3章例子的一个问题

本人菜鸟,现正在学习C++。《C++程序设计原理与实践》第3章有一个例子,代码如下:
#include
#include
#include
#include
#include
using namespace std;
inline void keep_window_open(){ char ch; cin >> ch; }
int main() //C++ Programs start by executing the function main
{
cout << "Please enter a floating-point value:";
double n;
cin >> n;
cout << "n==" << n
<< "\nn+1==" << n + 1
<< "\nthree times n==" << 3 * n
<< "\ntwice n==" << n + n
<< "\nhalf of n==" << n / 2
<< "\nsquared root of n==" << sqrt(n)
<< endl;
}
我执行后发现输入数字后再按回车会退出程序窗口。不知道为什么。请各位大神不吝赐教!谢谢!

用的什么编译器。vs的话同时按下ctrl+F5试试。
我试验过 程序运行正常。

函数末尾加上keep_Window_open();