Advertisement
a53

Maxcadou

a53
Aug 30th, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. int c[10];
  4.  
  5. int main()
  6. {
  7. unsigned long long int n;
  8. ifstream f("maxcadou.in");
  9. f>>n;
  10. while(n)
  11. ++c[n%10],n/=10;
  12. ofstream g("maxcadou.out");
  13. for(int i=9;i>=0;--i)
  14. for(int j=1;j<=c[i];++j)
  15. g<<i;
  16. g<<'\n';
  17. return 0;
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement