taking user input for a vector in c++ code example
Example: taking user input for a vector in c++
vector<int> g1;
for(i=0;i<n;i++)
{
cin>>a;
g1.push_back(a);
}
vector<int> g1;
for(i=0;i<n;i++)
{
cin>>a;
g1.push_back(a);
}