Advertisement
Guest User

Untitled

a guest
May 20th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <fstream>
  4. #include <iomanip>
  5. #include <string>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     ifstream in("input.txt");
  12.     ofstream out("output.txt");
  13.     fstream H("Help.txt");
  14.  
  15.     string s, p;
  16.     int b, a;
  17.  
  18.     while (in.peek() != EOF)
  19.     {
  20.         in >> b;
  21.         if (b > 0)
  22.             out << b << " ";
  23.         else
  24.             H << b << " ";
  25.     }
  26.  
  27.     H.close();
  28.     H.open("Help.txt");
  29.  
  30.     while (H >> a)
  31.     {
  32.         //H >> a;
  33.         out << a << " ";
  34.     }
  35.  
  36.     in.close();
  37.     H.close();
  38.     out.close();
  39.  
  40.     system("pause");
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement