Advertisement
Infiniti_Inter

56 2 (7)

May 14th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.  
  9.     ifstream in1("in1.txt");
  10.     ifstream in2("in2.txt");
  11.     ofstream out("output.txt");
  12.     while (in1.peek() != EOF)
  13.     {
  14.         int cur;
  15.         in1 >> cur;
  16.         if (cur > 0)
  17.             out << cur << ' ';
  18.     }
  19.     while (in2.peek() != EOF)
  20.     {
  21.         int cur;
  22.         in2 >> cur;
  23.         if (cur < 0)
  24.             out << cur << ' ';
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement