Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- void print_vector(vector<int> v)
- {
- for (int i = 0; i < v.size(); i++)
- {
- cout << v[i] << " ";
- }
- cout << endl;
- }
- int main(int argc, const char * argv[]) {
- int n, x;
- cin >> n;
- vector<int> v;
- for (int i = 0; i < n; i++)
- {
- cin >> x;
- v.push_back(x);
- print_vector(v);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement