fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. vector<int> v(3);
  8.  
  9. v[0] = 5;
  10. v[1] = 10;
  11. v[2] = 17;
  12. v.push_back(19);
  13.  
  14. cout << v.front() << endl;
  15. cout << v.back() << endl;
  16. cout << v.at(2) << endl;
  17. return 0;
  18. }
Success #stdin #stdout 0s 4404KB
stdin
Standard input is empty
stdout
5
19
17