Advertisement
rotti321

Test9-2021 S3E3

May 17th, 2021
817
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main() {
  6.    int n,x,fr[10]={};
  7.    while(cin>>n){
  8.        while(n!=0){
  9.            x=n%10;
  10.            fr[x]++;
  11.            n=n/10;
  12.        }
  13.    }
  14.    for(int i=9;i>=0;i--){
  15.        for(int j=1;j<=fr[i];j++){
  16.            cout<<i;
  17.        }
  18.    }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement