Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream f("1.txt");
- ifstream g("2.txt");
- ofstream h("3.txt");
- double a, b, c;
- while(!f.eof())
- {
- f >> a;
- g >> b;
- c = (a + b) / 2;
- h << c << " ";
- }
- f.close();
- g.close();
- h.close();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment