#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#define NUM 10
int input(double height[], int num)
{
double h;
int i;
for (i = 0; i < num; ) {
if (scanf("%lf", &h
) != 1) { continue;
}
height[i++] = h;
}
return 0;
}
void calc(double height[], int num, double *psum, double *pavg)
{
int i;
*psum = 0;
for (i = 0; i < num; i++) {
*psum += height[i];
}
*pavg = *psum / num;
}
void disp(double sum, double avg)
{
}
int main()
{
double height[NUM];
double sum, avg;
input(height, NUM);
calc(height, NUM, &sum, &avg);
disp(sum, avg);
return 0;
}
I2RlZmluZSBfQ1JUX1NFQ1VSRV9OT19XQVJOSU5HUwoKI2luY2x1ZGUgPHN0ZGlvLmg+CgojZGVmaW5lIE5VTSAxMAoKaW50IGlucHV0KGRvdWJsZSBoZWlnaHRbXSwgaW50IG51bSkKewoJZG91YmxlIGg7CglpbnQgaTsKCglmb3IgKGkgPSAwOyBpIDwgbnVtOyApIHsKCQlwcmludGYoIui6q+mVtyglZCk6IiwgaSArIDEpOwoJCWlmIChzY2FuZigiJWxmIiwgJmgpICE9IDEpIHsKCQkJY29udGludWU7CgkJfQoJCWhlaWdodFtpKytdID0gaDsKCX0KCXJldHVybiAwOwp9Cgp2b2lkIGNhbGMoZG91YmxlIGhlaWdodFtdLCBpbnQgbnVtLCBkb3VibGUgKnBzdW0sIGRvdWJsZSAqcGF2ZykKewoJaW50IGk7CgoJKnBzdW0gPSAwOwoJZm9yIChpID0gMDsgaSA8IG51bTsgaSsrKSB7CgkJKnBzdW0gKz0gaGVpZ2h0W2ldOwoJfQoJKnBhdmcgPSAqcHN1bSAvIG51bTsKfQoKdm9pZCBkaXNwKGRvdWJsZSBzdW0sIGRvdWJsZSBhdmcpCnsKCXByaW50Zigi5ZCI6KiIPSVmXG4iLCBzdW0pOwoJcHJpbnRmKCLlubPlnYc9JWZcbiIsIGF2Zyk7Cn0KCmludCBtYWluKCkKewoJZG91YmxlIGhlaWdodFtOVU1dOwoJZG91YmxlIHN1bSwgYXZnOwoKCWlucHV0KGhlaWdodCwgTlVNKTsKCWNhbGMoaGVpZ2h0LCBOVU0sICZzdW0sICZhdmcpOwoJZGlzcChzdW0sIGF2Zyk7CglyZXR1cm4gMDsKfQo=