Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. ifstream g("nr.in");
  4. ofstream f("nr.out");
  5. int i,d,c[10],n;
  6. int main()
  7. {
  8. while(g>>n)
  9. {
  10. while(n!=0){
  11. c[n%10]++;
  12. n=n/10;}
  13. }
  14. for(i=9;i>=0;i--)
  15. {
  16. for(d=1;d<=c[i];d++)
  17. f<<i;
  18. }
  19. return 0;
  20. }//idk ce ai gresit lol :))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement