Advertisement
Guest User

szerda_03

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