From a69cd34091836c632c3268e646ac5a85fb9f8175 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 29 Oct 2021 10:27:03 +0300 Subject: Added my solutions to Sem. 03 exercises --- .../Solutions Sem. 03/06. Polynomial_Solutions.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Year 1/Programming introduction/Solutions Sem. 03/06. Polynomial_Solutions.cpp (limited to 'Year 1/Programming introduction/Solutions Sem. 03/06. Polynomial_Solutions.cpp') 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 + +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; +} -- cgit v1.3.1-26-gb76a