If number of input are given as first input.
If I need to store them in vector
I can easily do it by creating a variable and using the variable I can append it in the vector
I'm fascinated to know , is there any other way so that I need not have to use a variable..
INPUT
4
1 5 3 2
How vector take inputs
vector<int>vec;
for(int i=0;i<n;i++)
{
int x;
cin>>x; // any idea to remove using a variable here..?
vec.emplace_back(x);
}
How array takes inputs
int array[n];
for(int i=0;i<n;i++)
cin>>array[i];