
| 以下是代码片段: #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> v; for (int i = 0; i < 10; ++i) { v.push_back(i); } for_each(v.begin(), v.end(), [](int n) { cout << n << " "; }); cout << endl; } |
| 欢迎光临 IT家园 (http://bbs.it998.com/) | Powered by Discuz! 7.2 |