Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 212f4f3 commit d868811Copy full SHA for d868811
‎code/2/2.11.for.loop.cpp
@@ -10,15 +10,15 @@
10
#include <iostream>
11
#include <vector>
12
#include <algorithm>
13
-
+using namespace std;
14
int main() {
15
- std::vector<int> vec = {1, 2, 3, 4};
16
- if (auto itr = std::find(vec.begin(), vec.end(), 3); itr != vec.end()) *itr = 4;
+ vector<int> vec = {1, 2, 3, 4};
+ if (auto itr = find(vec.begin(), vec.end(), 3); itr != vec.end()) *itr = 4;
17
for (auto element : vec)
18
- std::cout << element << std::endl; // read only
+ cout << element << endl; // read only
19
for (auto &element : vec) {
20
element += 1; // writeable
21
}
22
23
24
-}
+}
0 commit comments