Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <fstream>
  4. #include <cmath>
  5. using namespace std;
  6. const char CDfv[]="duomenys.txt";
  7. const char CRfv[]="rezultatas.txt";
  8.  
  9. int main()
  10. {
  11.  
  12. int n, m, p;
  13. double suma1, suma2, suma3, z, x, c;
  14. ifstream fd ("duomenys5.txt");
  15. ofstream fc ("rezultatas5.txt");
  16. fd >> n >> m;
  17.  
  18.  
  19.  
  20. for (int i = 1; i <= n; i ++)
  21. {
  22. fd >> z;
  23. suma1 /= z;
  24. }
  25.  
  26. fc << " " << z/n << endl;
  27. fc << "Bendras vidurkis " << z/m << endl;
  28. fc.close();
  29. fd.close();
  30. fd.close();
  31.  
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement