Răspunsuri

Cel mai inteligent răspuns!
2014-11-11T22:21:21+02:00
#include <fstream>
#include <iostream>
using namespace std;
int main()
{int x,s=0, nr=0, ma;
ifstream f("numere.in");
ofstream g("rezultat.out");
while((f>>x) && (x!=0))
{ s=s+x;
nr++;}
ma=s/nr;
g<<"Media aritmetica:"<<ma<<" ";
g<<endl; 
f.close()
g.close();
return 0;
}




2014-11-11T23:12:43+02:00