mirror of
https://github.com/Estom/notes.git
synced 2026-02-03 02:23:31 +08:00
16 lines
241 B
C++
16 lines
241 B
C++
#include<iostream>
|
|
#include<vector>
|
|
#include<algorithm>
|
|
using namespace std;
|
|
|
|
|
|
int main(){
|
|
|
|
vector<int> vec{1,2,3};
|
|
for_each(vec.begin(),vec.end(), [&](int &a){
|
|
a++;
|
|
});
|
|
for(auto a:vec){
|
|
cout<<a<<endl;
|
|
}
|
|
} |