#include #include #include 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; }