- #include<bits/stdc++.h>
- using namespace std;
- void dump(vector <int>& vt)
- {
- for(auto x:vt)
- cout << x << " ";
- cout << endl;
- }
- int main()
- {
- vector <int> a{1,2,3};
- cout << "Size before: " << a.size() << endl;
- int n;
- cin >> n;
- a.resize(n);
- dump(a);
- cout << "Size after: " << a.size() << endl;
- return 0;
- }
Raw Paste