Răspuns:
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("note.in");
ofstream g("note.out");
int main()
{
int n,nota, i, m5=0, n7=0, m=0;
float ma, s=0;
f >> n;
for (i=1; i<=n; i++) {
f >> nota;
if (nota<5) ++m5;
if (nota>5) { s+=nota; ++m; }
if (nota==7) ++n7;
}
g << "a) " << m5 << endl;
ma=s/m;
g << "b) " << ma << endl;
g << "c) " << n7;
return 0;
}
Explicație:
Succese!