Bob103

Таблица значений f(x)

Oct 26th, 2015
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. void f(float x)
  5. {
  6. if (!x || x <= -1)cout << "Function undefined";
  7. else cout << sqrt(pow(x, 3) - 1) / sqrt(pow(x, 2) - 1);
  8. }
  9. int main()
  10. {
  11. float a, b, h, x;
  12. cout << "a="; cin >> a;
  13. cout << "b="; cin >> b;
  14. cout << "h="; cin >> h;
  15. cout << "x\tf(x)\n";
  16. for (x = a; x <= b; x += h)
  17. {
  18. cout << x << "\t";
  19. f(x);
  20. cout << endl;
  21. }
  22. system("pause");
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment