home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 June
/
PCWorld_1998-06_cd.bin
/
software
/
Programy
/
Ozogan
/
PRUMER.IPS
< prev
next >
Wrap
Text File
|
1998-03-25
|
601b
|
20 lines
FUNCTION prumer(cislo : array of real) : real;
VAR
x : integer;
soucet : real
ENDVAR
soucet := 0; {nulovßnφ souΦtu}
FOR x := low(cislo) to high(cislo) {rozsah pomocφ indexu}
WRITELN(x:2, ':', cislo[x]:10:3); {v²pis hodnoty}
soucet := soucet + cislo[x];
ENDFOR
WRITELN('-------------');
WRITELN('SouΦet:',soucet:6:2);
WRITELN('Pr∙m∞r:',soucet/(high(cislo)-low(cislo)):6:2);
ENDFUNC
PROCEDURE main
ConsoleClear; ConsoleShow;
Prumer([13, 3, 5, 1]); {zkuste vlastnφ hodnoty, r∙zn² poΦet}
ENDPROC