#include <iostream>
#include <fstream>
using namespace std;
ofstream f_out("numar.out");
int main()
{
int cifre[10] = { 0 };
unsigned long long n;
cin >> n;
while (n) {
cifre[n % 10]++;
n /= 10;
}
for (int index = 9; index >= 0; index--)
while (cifre[index]--)
f_out << index;
return 0;
}
Coroană, pls? ;D