解決vs2012的C++運行結果顯示太快的問題

在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;
}
運行結果


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章