Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- #include <iomanip>
- using namespace std;
- void Print(const vector <int>& v, const string& title)
- {
- cout << title << ": ";
- for (const auto& i : v)
- {
- cout << i << ' ';
- }
- }
- int main()
- {
- vector<int> v = { 1,3,5,2,4 };
- Print(v, "init");
- /*for (int i = 0; i < v.size(); ++i)
- {
- ++v[i];
- }*/
- for (auto& i : v)
- {
- ++i;
- }
- cout << endl;
- Print(v, "inc");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement