#include <stdio.h>
int main(void)
{
int nArray[5], nCount, nInput, nSum;
double dAverage;
for(nCount=0;nCount<5;) {
if(0 < nInput) {
nArray[nCount] = nInput;
nCount++;
}
}
for(nCount=0,nSum=0;nCount<5;nCount++) {
nSum += nArray[nCount];
}
dAverage = (double)nSum / 5;
printf("nAverage:%.1f\n", dAverage
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKQp7CglpbnQgbkFycmF5WzVdLCBuQ291bnQsIG5JbnB1dCwgblN1bTsKCWRvdWJsZSBkQXZlcmFnZTsKCQoJZm9yKG5Db3VudD0wO25Db3VudDw1OykJewoJCXNjYW5mKCIlZCIsICZuSW5wdXQpOwoJCWlmKDAgPCBuSW5wdXQpCXsKCQkJbkFycmF5W25Db3VudF0gPSBuSW5wdXQ7CgkJCW5Db3VudCsrOwoJCX0KCX0KCQoJZm9yKG5Db3VudD0wLG5TdW09MDtuQ291bnQ8NTtuQ291bnQrKykJewoJCW5TdW0gKz0gbkFycmF5W25Db3VudF07Cgl9CglkQXZlcmFnZSA9IChkb3VibGUpblN1bSAvIDU7CglwcmludGYoIm5TdW06JWRcbiIsIG5TdW0pOwoJcHJpbnRmKCJuQXZlcmFnZTolLjFmXG4iLCBkQXZlcmFnZSk7CgoJcmV0dXJuIDA7Cn0K