Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program lab1_1;
- Uses
- SysUtils;
- var
- Number: Double;
- ColOfNumber:Integer;
- IsCorrect: Boolean;
- begin
- writeln ('Данная программа позволяет узнать количество цифр , из которых состоит число');
- repeat
- Iscorrect := true;
- try
- writeln('Введите число');
- readln(Number);
- except
- IsCorrect := false;
- end;
- if (Number<0) then
- IsCorrect := false;
- if (NOT IsCorrect) then
- begin
- writeln('Введите неотрицательное целое число');
- end;
- until (IsCorrect);
- while (Number>1) do
- begin
- Number:= Number / 10;
- ColOfNumber := ColOfNumber +1;
- end;
- writeln('Количество цифр равно ' , ColOfNumber );
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement