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