Advertisement
Uncleeee

Лямбда

Jan 29th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. vector<int> v {1,5,3,2,4};
  10. sort(v.begin(),v.end(),[](int a, int b){return a<b;});
  11. for (auto x: v)
  12. cout << x;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement