int main() {
std::string str;
//read whole line into str
std::getline(std::cin, str);
std::stringstream ss(str);
//create a istream_iterator from the stringstream
// Note the <int> because you want to read them
//as integers. If you want them as strings use <std::string>
auto start = std::istream_iterator<int>{ ss };
//create an empty istream_iterator to denote the end
auto end= std::istream_iterator<int>{};
//create a vector from the range: start->end
std::vector<int> input(start, end);
}
vector< int >arr;
string input;
getline(cin, input);
istringstream is(input);
int num;
while(is>>num) arr.push_back(num);
#include <iostream>
#include <vector>
#include <sstream>
using namespace std;
int main()
{
vector< int >arr;
string input;
getline(cin, input);
istringstream is(input);
int num;
char c;
while(true)
{
is>>num;
arr.push_back(num);
if(!is.eof()) is>>c;
else break;
}
for(int x: arr)
cout<< x <<" ";
}