deced

Untitled

Dec 24th, 2020 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. var
  2. I, M: Integer;
  3. X, H, A, B, Fx: Real;
  4. t: Text;
  5.  
  6. begin
  7. assign(t, 'out.txt');
  8. rewrite(t);
  9. M := 15;
  10. A := Pi / 8;
  11. B := 2 / pi;
  12. writeln(' Xi ', '| ', ' F(x) ', '| i | ');
  13. writeln(t, ' Xi ', '| ', ' F(x) ', '| i | ');
  14. H := (B - A) / M;
  15. for I := 1 to M do
  16. begin
  17. writeln('------------------');
  18. writeln(t,'------------------');
  19. X := X + H;
  20. Fx := sin(1/X);
  21. writeln(X:5:3, '|', Fx:6:2, ' |', I:2, ' |');
  22. writeln(t,X:5:3, '|', Fx:6:2, ' |', I:2, ' |');
  23. end;
  24. close(t);
  25. end.
Add Comment
Please, Sign In to add comment