Josif_tepe

Untitled

Oct 1st, 2025
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7.    
  8.     vector<int> v;
  9.    
  10.     v.push_back(1);
  11.     v.emplace_back(2);
  12.     v.push_back(3);
  13.    
  14.     for(int i = 0; i < (int) v.size(); i++) {
  15.         cout << v[i] << " ";
  16.     }
  17.     cout << endl;
  18.    
  19.     for(int x: v) {
  20.         cout << x << " ";
  21.     }
  22.     cout << endl;
  23.    
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment