Advertisement
l3p

4pr3.pas

l3p
Dec 12th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.93 KB | None | 0 0
  1. var
  2.    a, b, c : double;
  3.     Xn, Xk, dX, Fx, x : double;
  4.     g, h, j : byte;
  5.    expr, f : integer;
  6.    
  7. begin
  8.    readln(a, b, c, Xn, Xk, dX);
  9.     g := trunc(a);
  10.     h := trunc(b);
  11.     j := trunc(c);
  12.    expr := (g xor h) and not(g or j);
  13.    x := Xn;
  14.  
  15.    while x <= Xk do
  16.       begin
  17.         f := 1;
  18.         if (x = 0) and (b <> 0) then
  19.              Fx := a * (x - c) * (x - c) - b
  20.         else
  21.             if (x = 0) and (b = 0) then
  22.                 if (x - c) <> 0 then
  23.                     Fx := (x - a)/(- c)
  24.                 else f := 0
  25.             else
  26.                 if c <> 0 then
  27.                     Fx := a + x / c
  28.                 else f := 0;
  29.  
  30.         if f = 1 then
  31.             if expr <> 0 then
  32.                 writeln(' ', x:0:2, ' ', Fx:0:2)
  33.             else
  34.                 writeln(' ', x:0:2, ' ', trunc(Fx))
  35.         else writeln(' ', x:0:2, ' неопр.');
  36.            
  37.         x += dX;
  38.       end;
  39. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement