diff options
Diffstat (limited to 'codeforces/HelpfulMaths')
| -rw-r--r-- | codeforces/HelpfulMaths/HelpfulMaths.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/codeforces/HelpfulMaths/HelpfulMaths.cpp b/codeforces/HelpfulMaths/HelpfulMaths.cpp new file mode 100644 index 0000000..580b2fa --- /dev/null +++ b/codeforces/HelpfulMaths/HelpfulMaths.cpp @@ -0,0 +1,24 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main() { + string s; + cin >> s; + vector<int> v; + for (auto ch : s) { + if(ch != '+') { + v.push_back(ch - 48); + } + } + sort(v.begin(), v.end()); + for(int i = 0; i < v.size(); i++) { + if(i == v.size() - 1) { + cout << v[i]; + } + else { + cout << v[i] << "+"; + } + } + cout << '\n'; +} |
