求一组数据(2,4,8,16,32)的均数,该怎么做
来源:百度知道 编辑:UC知道 时间:2024/06/09 20:53:06
急急急!!!
(2+2+4+8+16+32)/5=12.8
注:“5”为数字个数,这题可用公式做:
数字总和/数字个数=均数
无头
pascal:
var
x,n,i:integer;s:real;
begin
writeln('How many number are there?Input:');
readln(n);
s:=0;
for i:=1 to n do
begin
read(x);s:=s+x;
end;
s:=s/n;
write('The mean is ',s:0:2);
end.