Advertisement
Eksekk

K01A C

Jun 25th, 2021
933
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <string>
  2.  
  3. std::string::iterator function(std::string::const_iterator a, std::string::const_iterator b, std::string::iterator wyjscie)
  4. {
  5.     while (a != b)
  6.     {
  7.         char znak = *a;;
  8.         while (isspace(*a) && a != b)
  9.         {
  10.             ++a;
  11.         }
  12.         if (isspace(znak))
  13.         {
  14.             *wyjscie++ = ' ';
  15.         }
  16.         else
  17.         {
  18.             *wyjscie++ = znak;
  19.             ++a;
  20.         }
  21.     }
  22.     return wyjscie;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement