Răspuns:
#include <iostream>
using namespace std;
int main(){
float V[100], n, i, aux, x, y, z, medAritmPoz, medArm, medAritmNen;
x = y = z = medAritmPoz = medArm = medAritmNen = 0;
cin >> n;
for(i = 1; i <= n; i++)
cin >> V[i];
for(i = 1; i <= n; i++){
if(V[i] >= 0){
x++;
medAritmPoz = medAritmPoz + V[i];
}
else if(V[i] != 0){
y++;
medAritmNen = medAritmNen + V[i];
}
else{
z++;
aux = 1.0/V[i];
medArm = medArm + aux;
}
}
cout << "Media Aritm a val poz " << medAritmPoz / x << endl;
cout << "Media Armonica "<< medArm / z << endl;
cout << "Media Aritm a val nenule " << medAritmNen / y;
return 0;
}