Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream in1("in1.txt");
- ifstream in2("in2.txt");
- ofstream out("output.txt");
- while (in1.peek() != EOF)
- {
- int cur;
- in1 >> cur;
- if (cur > 0)
- out << cur << ' ';
- }
- while (in2.peek() != EOF)
- {
- int cur;
- in2 >> cur;
- if (cur < 0)
- out << cur << ' ';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement