how to take unknown no of input in cpp
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int x;
vector<int> v;
while(cin>>x)
{
v.push_back(x);
}
for (int i = 0; i < v.size(); i++)
cout << v[i] << " ";
return 0;
}