Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <fstream>
- #include <cmath>
- using namespace std;
- const char CDfv[]="duomenys.txt";
- const char CRfv[]="rezultatas.txt";
- int main()
- {
- int n, m, p;
- double suma1, suma2, suma3, z, x, c;
- ifstream fd ("duomenys5.txt");
- ofstream fc ("rezultatas5.txt");
- fd >> n >> m;
- for (int i = 1; i <= n; i ++)
- {
- fd >> z;
- suma1 /= z;
- }
- fc << " " << z/n << endl;
- fc << "Bendras vidurkis " << z/m << endl;
- fc.close();
- fd.close();
- fd.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement