diff --git a/code/2/2.11.for.loop.cpp b/code/2/2.11.for.loop.cpp index a843c404..1dedba07 100644 --- a/code/2/2.11.for.loop.cpp +++ b/code/2/2.11.for.loop.cpp @@ -10,15 +10,15 @@ #include #include #include - +using namespace std; int main() { - std::vector vec = {1, 2, 3, 4}; - if (auto itr = std::find(vec.begin(), vec.end(), 3); itr != vec.end()) *itr = 4; + vector vec = {1, 2, 3, 4}; + if (auto itr = find(vec.begin(), vec.end(), 3); itr != vec.end()) *itr = 4; for (auto element : vec) - std::cout << element << std::endl; // read only + cout << element << endl; // read only for (auto &element : vec) { element += 1; // writeable } for (auto element : vec) - std::cout << element << std::endl; // read only -} \ No newline at end of file + cout << element << endl; // read only +}