Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <map>
- #include <algorithm>
- #include <functional>
- using namespace std;
- int main()
- {
- string s;
- cin >> s;
- vector<int> numbers;
- for (auto it : s) {
- numbers.emplace_back(it - '0');
- }
- sort(numbers.begin(), numbers.end());
- for (auto it : numbers) {
- cout << it;
- }
- cout << " ";
- sort(numbers.begin(), numbers.end(), greater<int>());
- for (auto it : numbers) {
- cout << it;
- }
- //system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement