Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //перегрузка 4 № 14
- #include <iostream>
- #include <cmath>
- #include <iomanip>
- using namespace std;
- float F(float x);
- void F(float x, float& y);
- int main()
- {
- float a, b, y, h;
- cin >> a >> b >> h;
- cout << fixed << setprecision(7);
- for (float i = a; i <= b; i += h)
- {
- y = F(i);
- F(i, y);
- }
- }
- float F(float x)
- {
- if (x < 0)
- return 0.2 * pow(x, 2) - x - 0.1;
- else if (x == 0.1)
- return 0;
- else if (x != 0)
- return pow(x, 2) / (x - 0.1);
- else
- return 0;
- }
- void F(float x, float& y)
- {
- cout << x << ' ' << y << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement