Răspuns:
#include<iostream>
using namespace std;
int main(){
float a, b ,c ,d ,e ,x = 0, y = 0, z = 0, u = 0, t = 0, sum, mediaAritmetica;
cin << a << b << c << d << e;
if(a > 0){
x = a;
}
if(b > 0){
y = b;
}
if(c > 0){
z = c;
}
if(d > 0){
u = d;
}
if(e > 0){
t = e;
}
sum = x + y + z + u + t;
mediaAritmetica = sum/5;
cout << mediaAritmetica << endl;
return 0;
}