You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

19 lines
398 B
C++

#include <iostream>
#include <string>
#include <algorithm>
using std::cout, std::string, std::endl;
void move_spaces(string& s) {
std::stable_sort(s.begin(), s.end(), [](const char& a, const char& b){ return (b == ' '); });
}
int main() {
string s;
std::getline(std::cin, s);
move_spaces(s);
// So we can see spaces
cout << s << "###" << endl;
}