Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. ifstream fin ("cifre.in");
  5. ofstream fout ("cifre.out");
  6. int main ()
  7. {
  8. int a , b , v[10] = {0}, c ;
  9. cin >> a >> b ;
  10. while (a)
  11. {
  12. c=a%10;
  13. v[c]++;
  14. a/=10;
  15. }
  16. while (b)
  17. {
  18. c=b%10;
  19. v[c]++;
  20. b/=10;
  21. }
  22. for(c=9; c >=0 ; c--)
  23. while (v[c])
  24. {
  25. cout << c ;
  26. v[c]--;
  27. }
  28.  
  29. return 0 ;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement