题目: |
program cz2011_1;
var n,i,c:longint; ave,s:extended;
f:array[1..10000]of longint;
begin
read(n); ave:=0;
for i:=1 to n do begin
read(f[i]);
ave:=ave+f[i];
end;
ave:=ave/n; s:=0;c:=0;
for i:=1 to n do begin
if f[i]<ave then c:=c+1;
s:=s+(f[i]-ave)*(f[i]-ave);
end;
s:=s/n;
writeln(ave:0:2,' ',c,' ',s:0:2);
end.
输入:
5
73 76 83 91 77 输出:80.00 3 40.08
|