daily pastebin goal
11%
SHARE
TWEET

szerda_03

a guest Jan 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top