Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- vector<int> a{1, 2, 3, 4, 5};
- vector<int> b{5, 4, 3, 2, 1};
- transform(a.begin(), a.end(), b.begin(), a.begin(), [](int a1, int a2) { return a1 - a2; });
- for(int i : a) cout << i << ' ';
- }
Advertisement
Add Comment
Please, Sign In to add comment