#include #include #include using namespace std; int main(){ int n,m,cnt; vectorvec; vector::iterator ip; int data[10] = {}; scanf("%d",&n); while(n){ m = n % 10; data[cnt] = m; n/=10; cnt++; } for(int i = 0; i < cnt; i++){ vec.push_back(data[i]); } sort(vec.begin(),vec.end(),greater()); ip = vec.begin(); while(ip != vec.end()){ cout << *ip; ip++;} cout << "\n"; return 0; }