Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <cmath>
- #include <set>
- #include <array>
- using namespace std;
- void f(vector<int> v) {
- for(int i = 0; i < v.size(); i++) {
- v[i] = 2;
- }
- }
- int main() {
- vector<int> v = {1, 2, 3, 4};
- f(v);
- for(int i = 0; i < v.size(); i++) {
- cout << v[i] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement