您的位置:首页 > 其它

初涉VS2010 关于调试下输入后enter直接退出问题

2017-02-13 08:01 651 查看
代码如下

#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进行调试的时候


就会直接退出显示下面



遇到这种情况我们只需要在程序结束的时候 添加断点



如上图显示



这样就解决了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: