#include <string> #include <vector> ... string rawInput; vector<String> numbers; while( getline( cin, rawInput, ' ' ) ) { numbers.push_back(rawInput); }