Advertisement
Tec4Gen

Untitled

Nov 12th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include<iostream>
  2. #include<iomanip>
  3. using namespace std;
  4. void f(float x) {
  5. float i = 0.1;
  6. if (x < 0) {
  7. cout << "равна" << " " << 0.2*pow(x, 2) - x - i << endl;
  8. }
  9. else if (x > 0 && x != i) {
  10. cout << "равна" << " " << (pow(x, 2)) / (x - i) << endl;
  11. }
  12. else {
  13.  
  14. cout << "равна" << " " << "0" << endl;
  15. }
  16. }
  17. int main() {
  18. setlocale(LC_ALL, "Russian");
  19. float a, b, h;
  20. cout << "Введите a: ";
  21. cin >> a;
  22. cout << "Введите b: ";
  23. cin >> b;
  24. cout << "Введите h: ";
  25. cin >> h;
  26.  
  27. for (a; a <= b; a += h) {
  28. cout << "Для x = " << a << " " << "Функция" << " ";
  29. f(a);
  30. }
  31.  
  32. system("pause");
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement