Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int a, b, c;
  6.  
  7. double f(int x) {
  8.     if (c < 0 && a != 0)
  9.         return -a * x * x;
  10.  
  11.     if (c > 0 && a == 0)
  12.         return (a - x) * 1.0 / (x * c);
  13.  
  14.     return x * 1.0 / c;
  15. }
  16.  
  17. int main() {
  18.     int x_start, x_finish, step;
  19.  
  20.     cin >> x_start >> x_finish >> step;
  21.  
  22.     cin >> a >> b >> c;
  23.  
  24.     for (int i = x_start; i <= x_finish; i += step) {
  25.         cout << f(i) << "\n";
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement