Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program Задание3;
- Uses System.SysUtils;
- Var
- Eps, Sum, K: Real;
- IsCorrect: Boolean;
- Begin
- IsCorrect := False;
- K := 1;
- Write('Введите EPS: ');
- Repeat
- Try
- Readln(Eps);
- If Not (Eps > 1) And (Eps > 0) Then
- IsCorrect := True
- Else
- Writeln('Введите положительное число не больше 1');
- Except
- Writeln('Введите вещественное число!');
- End;
- Until IsCorrect;
- While Not (K < Eps) do
- Begin
- Sum := Sum + K;
- K := K / 2;
- End;
- Writeln('Сумма членов ряда: ', FormatFloat('0.##############', Sum));
- Readln(K);
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement