One way is to use getline, and then just parse the string.
Code:
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
double number = 0.0;
int times = 2;
cout << "Enter in a number: ";
cin >> number;
cin.ignore(100, '\n'); // Ignore extra characters after the number, including the newline.
// This is necessary if you mix >> and getline.
cout << "Enter the times to be multiplied by itself: ";
string input;
getline(cin, input);
if (!input.empty())
{
istringstream istr(input);
istr >> times;
}
cout << "number = " << number << endl;
cout << "times = " << times << endl;
return 0;
}