Versi XHTML
var c, d, max, min : real; p : array [1..10002] of real; a, b : integer; begin readln(a); c:=0; for b:= 1 to a do begin readln(p[b]); c := c + p[b]; end; d:= c/a; max := p[1]; min := p[1]; for b:= 2 to a do begin if p[b] > max then max := p[b]; if p[b] < min then min := p[b]; end; write(min:0:2,' ',max:0:2,' ',d:0:2); writeln; end.
Versi CSS
var c, d, max, min : real; p : array [1..10002] of real; a, b : integer; begin readln(a); c:=0; for b:= 1 to a do begin readln(p[b]); c := c + p[b]; end; d:= c/a; max := p[1]; min := p[1]; for b:= 2 to a do begin if p[b] > max then max := p[b]; if p[b] < min then min := p[b]; end; write(min:0:2,' ',max:0:2,' ',d:0:2); writeln; end.
Versi Java Script
var c, d, max, min : real; p : array [1..10002] of real; a, b : integer; begin readln(a); c:=0; for b:= 1 to a do begin readln(p[b]); c := c + p[b]; end; d:= c/a; max := p[1]; min := p[1]; for b:= 2 to a do begin if p[b] > max then max := p[b]; if p[b] < min then min := p[b]; end; write(min:0:2,' ',max:0:2,' ',d:0:2); writeln; end.
Tidak ada komentar:
Posting Komentar
Habis baca alangkah baiknya untuk memberikan comment..
silahkan comment disini..
ingat !!
dilarang spamming, bicara PORNO atau SARA