Advertisement
FuFsQ

Untitled

Sep 14th, 2021
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. var
  2. n, i, ctr: integer;
  3. cp,a,b,dt: Real;
  4.  
  5.  
  6. function clc_function(cpos: Real): Real;
  7. var
  8. ret:real;
  9. begin
  10. while cpos > 4 do
  11. begin
  12. cpos := cpos - 4;
  13. end;
  14.  
  15. if (cpos >= 0) and (cpos <= 1) then
  16. begin
  17. ret := cp + 1;
  18. clc_function := ret;
  19. end;
  20.  
  21. if (cpos >= 1) and (cpos <= 3) then
  22. begin
  23. ret := (3 / 2) * (cpos - 1) - 1;
  24. clc_function := ret;
  25. end;
  26.  
  27. if (cpos >= 3) and (cpos <= 4) then
  28. begin
  29. clc_function := 1;
  30. end;
  31. end;
  32.  
  33. begin
  34. readln(a, b, n);
  35.  
  36. cp := a;
  37. dt := (b - a) / n;
  38. ctr := 1;
  39. writeln('№ ТОЧКИ | АРГУМЕНТ | ЗНАЧЕНИЕ');
  40. for i := 1 to n do
  41. begin
  42. writeln(ctr:8, ' | ', cp:6:6, ' | ', clc_function(cp):8:8);
  43. ctr := ctr + 1;
  44. cp := cp + dt;
  45. end;
  46. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement