Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- typedef std::string::iterator iter;
- typedef std::string::const_iterator citer;
- iter function(citer a, citer b, iter wyjscie)
- {
- citer aplus = a + 1;
- int dodane = 0;
- int rozm = b - a;
- while (aplus != b)
- {
- *wyjscie = *aplus;
- *(wyjscie + 1) = *a;
- dodane += 2;
- wyjscie += 2;
- ++a;
- ++aplus;
- if (aplus == b)
- {
- break;
- }
- ++a;
- ++aplus;
- }
- if (dodane != rozm)
- {
- *wyjscie++ = *a;
- }
- return wyjscie;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement