Advertisement
Guest User

tamas

a guest
Jan 23rd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <stdlib.h>
  4.  
  5. using namespace std;
  6.  
  7. int Gy[1000];
  8. int N;
  9.  
  10. void Olvas()
  11. {
  12. int x;
  13. ifstream f("szamok.txt");
  14. f>>N;
  15. for (int i=0; i<=N; i++)
  16. {
  17. f>>x;
  18. Gy[x]++;
  19. }
  20. }
  21. void Nyomtat()
  22. {
  23. ofstream g("novekvo.txt");
  24. for (int i=10; i<=999; i++)
  25. for (int j=1; j<=Gy[i]; j++)
  26. g<<i<<" "<<endl;
  27. g.close();
  28. }
  29. int main()
  30. {
  31. Olvas();
  32. Nyomtat();
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement