Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main() {
- int a, b, c, d, e;
- int counter = 0;
- std::cin >> a >> b >> c >> d >> e;
- for (int x = -100; x <= 100; x++) {
- int valueOfExpr = a * x * x * x * x + b * x * x * x + c * x * x + d * x + e;
- if (valueOfExpr >= 0) {
- std::cout << x << " ";
- counter += 1;
- }
- }
- if (counter == 0) {
- std::cout << "There are no roots in the interval [-100; 100].";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement