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