Răspuns:
#include <iostream>
using namespace std;
int main() {
int i, n, v[100], s = 0, nr = 0;
float ma;
cout <<"n=";
cin >> n;
for(i = 0; i < n; i++)
{
cout<<"v["<<i<<"]=";
cin>>v[i];
}
for(i = 0; i < n; i++)
{
if(v[i] % 5 == 0)
{
s = s + v[i];
nr++;
}
}
if(nr > 0)
{
ma = (float)s/nr;
}
cout << "s-au citit " << nr <<" numere divizibile cu 5\n";
cout<< "media lor aritmetica este: " << ma;
return 0;
}