Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main(){
- vector<int> v;
- for(int i = 0; i < 5; i++){
- v.push_back(i);
- } //v = [0, 1, 2, 3, 4]
- v.push_back(10); //v = [0, 1, 2, 3, 4, 10]
- // cout << v[5] << " " << v[3];
- for(int i = 0; i < v.size(); i++){
- cout << v[i] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment