Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main() {
- int n,x,fr[10]={};
- while(cin>>n){
- while(n!=0){
- x=n%10;
- fr[x]++;
- n=n/10;
- }
- }
- for(int i=9;i>=0;i--){
- for(int j=1;j<=fr[i];j++){
- cout<<i;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement