Тема: исчо задачка
Monk [Off] [#] (04.02.2012 / 13:55) |
program GW;
var k, N, l: integer;
begin
write('N = ');
readln(N);
k:=0;
l:=1;
if N mod 10 = 0 then
writeln('Eror')
else
begin
while N > 0 do
begin
k:= k+1;
if (k=9) or (k=99) or (k=999) or (k=9999) or (k=99999) or (k=999999) then
l:= l+1;
N:= N-l;
end;
writeln('k = ', k);
end;
end.