Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- template <typename It1, typename It2>
- It2 RazmijeniBlokove (It1 p1, It1 p2, It2 p3)
- {
- while (*p1!=*p2) std::swap (*p1++, *p3++);
- return p3;
- }
- template <typename tip>
- tip Ispisi(const tip &a)
- {
- for (auto x: a)
- std::cout<<x<<" ";
- }
- int main () {
- std::string a{1,2,3,4,5,6,7}, b{9,9,9,9,9,9,9,9,9};
- RazmijeniBlokove(a.begin(), a.end(), b.begin());
- Ispisi(a);
- Ispisi(b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement