c++ about while (!(cin>>x)) : i just start to learn C++. And there's my very first code. My question is that why i have to input the number twice when i run it ? 

    #include "stdafx.h"
    #include <iostream>

    using namespace std;

    int _tmain(int argc, _TCHAR* argv[])
    {
	    int x;
	    int number;
	
	    cout << "Please enter a integer ." << endl;
	    cin >> number;

	    while (!(cin>>x)) 
	    {
	    cout << "Invalid value !" << endl;
	    system("pause");
	    return 0;
	    }
	
	    cout << "Your number is " << number << " ." << endl