Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <fstream>
  2. #include <iterator>
  3. #include <algorithm>
  4. #include <set>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main() {
  10.     setlocale(LC_ALL, "Russian");
  11.    
  12.     fstream fst("file_name.txt");
  13.     istream_iterator<int> fst_it(fst);
  14.     istream_iterator<int> end_of_file;
  15.     multiset<int> s(fst_it, end_of_file);
  16.     fst.close();
  17.  
  18.     fst.open("file_name.txt");
  19.     ostream_iterator<int> ost(fst, " ");
  20.     copy(begin(s), end(s), ost);
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement