Advertisement
kolbka_

Untitled

Aug 31st, 2023
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. int left = 0;
  2. int right = 0;
  3. while(right < n){
  4. if (answer[right] == ' ') {
  5. int tmp = right - 1;
  6. while(left < tmp){
  7. std::swap(answer[left], answer[tmp]);
  8. left++;
  9. tmp--;
  10. }
  11. left = right + 1;
  12. }
  13. right++;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement