Строками: var s:string; begin WriteLn('vvedi chislo:'); ReadLn(s); WriteLn('chislo cifr=',length(s)); ReadLn; end; Не строками: var N,k:longint; begin write('N=');readln(N); k:=0; while N>0 do begin N:=N div 10; k:=k+1; end; write('k=',k); readln end.
var s:string;
begin
WriteLn('vvedi chislo:');
ReadLn(s);
WriteLn('chislo cifr=',length(s));
ReadLn;
end;
Не строками:
var N,k:longint;
begin
write('N=');readln(N);
k:=0;
while N>0 do
begin
N:=N div 10;
k:=k+1;
end;
write('k=',k);
readln
end.