代码如下
#include<iostream>
#include<cmath>
int main()
{
using namespace std;
double area;
cout<<"Enter the floor area,in square feet,of your home: ";
cin>> area;
double side;
side=sqrt(area);
cout<<"That's the equivalent of a square"<<side<<"feet to the side"<<endl;
cout<<"How fascinating"<<endl;
cin.get();
return side;
}
这里要求向area写入一个数并求其平方根,且将其保存在side下
然后我们按F5进行调试的时候
就会直接退出显示下面
遇到这种情况我们只需要在程序结束的时候 添加断点
如上图显示
这样就解决了