Bob103

Best 2!

May 14th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. ifstream f("1.txt");
  10. ifstream g("2.txt");
  11. ofstream h("3.txt");
  12. double a, b, c;
  13. while(!f.eof())
  14. {
  15. f >> a;
  16. g >> b;
  17. c = (a + b) / 2;
  18. h << c << " ";
  19. }
  20. f.close();
  21. g.close();
  22. h.close();
  23. system("pause");
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment