You are viewing a single comment's thread. Return to all comments →
// Can anyone help to find out the mistake
using namespace std;
int main() { vector v; int n,value; cin>>n; for(int i=0;i>value; v.push_back(value); } v.erase(v.begin()+1); v.erase(v.begin()+1,v.begin()+3);
for(int i=0;i<3;i++) { cout<<v[i]<<" "; } return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Vector-Erase
You are viewing a single comment's thread. Return to all comments →
// Can anyone help to find out the mistake
include
include
include
include
include
using namespace std;
int main() { vector v; int n,value; cin>>n; for(int i=0;i>value; v.push_back(value); } v.erase(v.begin()+1); v.erase(v.begin()+1,v.begin()+3);
}