Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program lab1_3;
- 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+1;
- Number:= Number / 10;
- ColOfNumber := ColOfNumber +1;
- End;
- Writeln('Количество цифр равно ' , ColOfNumber );
- Readln;
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement