Advertisement
myloyo

9.2.6

Dec 18th, 2022 (edited)
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <fstream>
  4. #include <string>
  5.  
  6. using namespace std;
  7. ifstream f1("input.txt"), f2("input2.txt");
  8. ofstream out("output.txt");
  9.  
  10. int main()
  11. {
  12.     int k, g;
  13.     int s = 0;
  14.     while (!f1.eof() && !f2.eof()) {
  15.         f1 >> k;
  16.         f2 >> g;
  17.         s = k + g;
  18.         out << (double)s / 2 << endl;
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement