program stopper; uses crt,dos; var ido,ido2,eltelt:real; procedure indit(var ido:real); var ora,perc,mp,s:word; begin gettime(ora,perc,mp,s); {ora,perc,mp,szazadmp:word} ido:=((ora*60+perc)*60+mp)*100+s; end; procedure allit(var ido2:real); var ora,perc,mp,s:word; begin gettime(ora,perc,mp,s); {ora,perc,mp,szazadmp:word} ido2:=((ora*60+perc)*60+mp)*100+s; end; procedure elsof(var eltelt:real); const n=100; var i,z,w:integer; s,d2:real; a:array[1..n] of real; begin indit(ido); for z:=1 to 1000 do for w:=1 to 10 do begin {--------------------------------------------} s:=0; for i:=1 to n do s:=a[i]/n; d2:=0; for i:=1 to n do d2:=d2+(s-sqr(a[i]))/n; {--------------------------------------------} end; allit(ido2); eltelt:=ido2-ido; end; procedure elsojav(var eltelt:real); const n=100; var i,z,w:integer; s,d2:real; a:array[1..n] of real; begin indit(ido); for z:=1 to 1000 do for w:=1 to 10 do begin {--------------------------------------------} s:=0; d2:=0; for i:=1 to n do begin s:=s+a[i]; d2:=d2+a[i]*a[i]; end; s:=s/n; d2:=s-d2/n; {--------------------------------------------} end; allit(ido2); eltelt:=ido2-ido; end; begin clrscr; elsof(eltelt); writeln('Rossz verzio eltelt ido: ',eltelt:5:2,' szazadmasodperc'); elsojav(eltelt); writeln('Jo verzio eltelt ido: ',eltelt:5:2,' szazadmasodperc'); readln; end.