Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <iomanip>
- using namespace std;
- ifstream fin("seka.txt");
- ofstream fout("seka_rez.txt");
- void skaiciuojam(int *c)
- {
- int z;
- z = *c;
- double newel, sum=0, minim=1000000, maxim=-1000000, vid;
- for(int i=0;z>i;i++)
- {
- fin >> newel;
- sum += newel;
- if(newel>maxim)
- {
- maxim=newel;
- }
- if(newel<minim)
- {
- minim=newel;
- }
- }
- fout<<minim<<endl;
- fout<<maxim<<endl;
- fout<<fixed<<setprecision(2)<<sum/z<<endl;
- }
- int main()
- {
- int g;
- int *c;
- fin >> g;
- c=&g;
- skaiciuojam(c);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement