Тема: исчо задачка
Monk [Off] [#] (03.02.2012 / 21:42) |
program GW;
var i, k: integer;
N, l: int64;
begin
write('write N ');
readln(N);
i:=0;
l:=1;
repeat
begin
l:= l*10;
i:= i+1;
end;
until N div l <= 0 ;
k:=0;
l:=1;
while i > 0 do
begin
k:= k+1;
if (k=9) or (k=99) or (k=999) then
l:= l+1;
i:= i-l;
end;
writeln('k = ', k);
end.