diff options
Added my solutions to Sem. 03 exercises
1 files changed, 18 insertions, 0 deletions
| -rw-r--r-- | Year 1/Programming introduction/Solutions Sem. 03/06. Polynomial_Solutions.cpp | 18 |
diff --git a/Year 1/Programming introduction/Solutions Sem. 03/06. Polynomial_Solutions.cpp b/Year 1/Programming introduction/Solutions Sem. 03/06. Polynomial_Solutions.cpp new file mode 100644 index 0000000..ba34792 --- /dev/null +++ b/Year 1/Programming introduction/Solutions Sem. 03/06. Polynomial_Solutions.cpp @@ -0,0 +1,18 @@ +#include <iostream> + +using namespace std; + +int main() +{ + int a, b, c, d, e; + cin >> a >> b >> c >> d >> e; + + double fx; + for (int x = -100; x <= 100; x++) + { + fx = a * x*x*x*x + b * x*x*x + c * x*x + d * x + e; + if (fx >= 0) + cout << x << " "; + } + cout << endl; +} |
