Last active
October 24, 2024 10:33
-
-
Save m1irka/3f3130fd39efd71984fac1e338a12016 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <math.h> | |
| using namespace std; | |
| int main() { | |
| double y; | |
| for (double i = -2; i <= 3; i += 0.2) | |
| { | |
| if (i>1.5) | |
| { | |
| y = 2.5 * pow(i, 3) + 6 * (i, 2) - 30; | |
| } | |
| if (0 <= i <= 1.5) | |
| { | |
| y = i + 1; | |
| } | |
| if (i < 0) | |
| { | |
| y = i; | |
| cout << "y = " << y << endl; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment