Тема: и снова задачка (паскаль блеать)
Monk [Off] [#] (08.02.2012 / 11:42) |
program LockeD;
var k, i, Rmax: integer;
R, R2: array [0..5000] of integer;
begin
repeat
begin
write ('k = ');
readln(k);
end;
until 5000 >= k;
R[0]:=0;
for i:=1 to k do
begin
repeat
begin
write('R[',i,'] = ');
readln(R[i]);
end;
until (10000 >= R[i])and (R[i]>= 10) and (R[i] > R[i-1]);
end;
for i:=k downto 2 do
begin
R2[i]:= R[i]-R[i-1];
end;
Rmax:=R[1];
for i:=2 to k do
begin
if R2[i] > Rmax then
Rmax:= R2[i];
end;
writeln('Rmax = ', Rmax);
end.