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