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.
0 komentar:
Post a Comment
Hey, It's my pleasure to know what was in your mind after reading the article above. So, you can comment or give critics to my writing on this comment box below