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