Advertisement
Guest User

Untitled

a guest
Sep 12th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 2.61 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.   if h <= 0 then
  13.     begin
  14.       writeln('error шаг прирожения должен быть положителььным. Нажмите enter для завершения...');
  15.       readln;
  16.       halt;
  17.     end;
  18.  
  19.   x := a;
  20.   repeat
  21.     if (x <= 0) or (abs(x - 5) < 0.0000001) then writeln('x = ', x:0:5, ' y = undefined')
  22.     else if x > 0 then
  23.       begin
  24.         if x < 5 then
  25.           if (exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3) > 0)
  26.             and (abs(ln(exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3))) > 0.0000001) then
  27.               begin
  28.                 y := ((x + 5) / x - exp(x / 3)) / ln(exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3));
  29.                 writeln('x = ', x:0:5, ' y = ', y:0:5);
  30.               end
  31.           else writeln('x = ', x:0:5, ' y = undefined')
  32.         else if (exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3) > 0)
  33.           and (abs(ln(exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3))) > 0.0000001) then
  34.             begin
  35.               y := ((x + 5) / x - exp(x / 3)) / ln(exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3));
  36.               writeln('x = ', x:0:5, ' y = ', y:0:5);
  37.             end
  38.         else writeln('x = ', x:0:5, ' y = udefined');
  39.       end;
  40.     x := x + h;
  41.   until (x >= b) or (abs(x - b) < 0.0000001);
  42.   x := b;
  43.  
  44.   if (x <= 0) or (abs(x - 5) < 0.0000001) then writeln('x = ', x:0:5, ' y = undefined')
  45.     else if x > 0 then
  46.       begin
  47.         if x < 5 then
  48.           if (exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3) > 0)
  49.             and (abs(ln(exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3))) > 0.0000001) then
  50.               begin
  51.                 y := ((x + 5) / x - exp(x / 3)) / ln(exp(ln(x) / 7) - exp(ln(2 / (5 - x)) / 3));
  52.                 writeln('x = ', x:0:5, ' y = ', y:0:5);
  53.               end
  54.           else writeln('x = ', x:0:5, ' y = undefined')
  55.         else if (exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3) > 0)
  56.           and (abs(ln(exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3))) > 0.0000001) then
  57.             begin
  58.               y := ((x + 5) / x - exp(x / 3)) / ln(exp(ln(x) / 7) + exp(ln(2 / (x - 5)) / 3));
  59.               writeln('x = ', x:0:5, ' y = ', y:0:5);
  60.             end
  61.         else writeln('x = ', x:0:5, ' y = undefined');
  62.       end;
  63.  
  64.   writeln('Нажмите enter для завершения...');
  65.   readln;
  66.  
  67. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement