Pages

Sabtu, 05 Januari 2013

BAB 1C : Perulangan -Rata rata

Solusi BAB 1C : Perulangan - Rata rata



PROGRAM ratarata;
VAR
n,i : integer;
b,k,r,m,jum : real;
BEGIN
readln(n);
k := 1000000;
b := -1000000;
for i:= 1 to n do
begin
readln(m);
jum := jum+m;
if m < k then k := m;
if m > b then b := m;
end;
r := jum/n;
writeln(k:0:2,' ',b:0:2,' ',r:0:2);
END.

Tidak ada komentar:

Posting Komentar