Advertisement
Guest User

Untitled

a guest
Sep 12th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 2.38 KB | None | 0 0
  1. program lab1;
  2. var
  3.   a, b, h, x, y : extended;
  4. begin
  5.   write('Введите начальное значение аргумента: ');
  6.   readln(a);
  7.   write('Введите конечное значение аргумента: ');
  8.   readln(b);
  9.   write('Введите шаг прирощения аргумента: ');
  10.   readln(h);
  11.  
  12.   x := a;
  13.   repeat
  14.     if (x <= 0) or (abs(x - 5) < 0.0000001) then writeln('x = ', x:0:5, ' y = undefined')
  15.     else if x > 0 then
  16.       begin
  17.         if x < 5 then
  18.           if (exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3) > 0)
  19.             and (abs(ln(exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3))) > 0.0000001) then
  20.               begin
  21.                 y := ((x + 5) / x - exp(x / 3)) / ln(exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3));
  22.                 writeln('x = ', x:0:5, ' y = ', y:0:5);
  23.               end
  24.           else writeln('x = ', x:0:5, ' y = undefined')
  25.         else if (exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3) > 0)
  26.           and (abs(ln(exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3))) > 0.0000001) then
  27.             begin
  28.               y := ((x + 5) / x - exp(x / 3)) / ln(exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3));
  29.               writeln('x = ', x:0:5, ' y = ', y:0:5);
  30.             end
  31.         else writeln('x = ', x:0:5, ' y = udefined');
  32.       end;
  33.     x := x + h;
  34.   until (x >= b) or (abs(x - b) < 0.0000001);
  35.   x := b;
  36.  
  37.   if (x <= 0) or (abs(x - 5) < 0.0000001) then writeln('x = ', x:0:5, ' y = undefined')
  38.     else if x > 0 then
  39.       begin
  40.         if x < 5 then
  41.           if (exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3) > 0)
  42.             and (abs(ln(exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3))) > 0.0000001) then
  43.               begin
  44.                 y := ((x + 5) / x - exp(x / 3)) / ln(exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3));
  45.                 writeln('x = ', x:0:5, ' y = ', y:0:5);
  46.               end
  47.           else writeln('x = ', x:0:5, ' y = undefined')
  48.         else if (exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3) > 0)
  49.           and (abs(ln(exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3))) > 0.0000001) then
  50.             begin
  51.               y := ((x + 5) / x - exp(x / 3)) / ln(exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3));
  52.               writeln('x = ', x:0:5, ' y = ', y:0:5);
  53.             end
  54.         else writeln('x = ', x:0:5, ' y = undefined');
  55.       end;
  56.  
  57.   writeln('Нажмите enter для завершения...');
  58.   readln;
  59.  
  60. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement