Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a, b, c;
- double f(int x) {
- if (c < 0 && a != 0)
- return -a * x * x;
- if (c > 0 && a == 0)
- return (a - x) * 1.0 / (x * c);
- return x * 1.0 / c;
- }
- int main() {
- int x_start, x_finish, step;
- cin >> x_start >> x_finish >> step;
- cin >> a >> b >> c;
- for (int i = x_start; i <= x_finish; i += step) {
- cout << f(i) << "\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement