解决vs2012的C++运行结果显示太快的问题

来源:互联网 发布:日本方向盘在哪边 知乎 编辑:程序博客网 时间:2024/05/16 17:39

在VS2012中编写的C++程序,运行结果太快而看不出结果的时候,要在return 0;之前加个system("pause");,运行结果如下:

#include <iostream>using namespace std ;int main(){std ::cout <<"enter two numbers:"<<std ::endl ;int v1,v2;std ::cin >>v1 >>v2 ;std ::cout <<"the number of "<<v1 <<"and"<<v2 <<"is"<<v1 + v2 <<std ::endl ;system("pause");return 0;}
运行结果


0 0
原创粉丝点击