Advertisement
Guest User

problema7

a guest
Mar 19th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int a[10];
  4. void ordnr(int n)
  5. {
  6. int i,c;
  7. if(n>0)
  8. {c=n%10;
  9. a[c]++;
  10. n=n/10;
  11. ordnr(n);}
  12. else
  13. for(i=0;i<=9;i++)
  14. for(c=1;c<=a[i];c++)
  15. cout<<i<<" ";
  16. }
  17. int main()
  18. {
  19. int n;
  20. cout<<"Introduceti numarul:";
  21. cin>>n;
  22. ordnr(n);
  23. r
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement