From 6ccd3659ee19f5199fa04730cba78504a1e6c128 Mon Sep 17 00:00:00 2001 From: Kapliuk Date: Wed, 6 Mar 2024 18:24:14 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=BD=D0=BE=D0=B2=D0=B8=D1=82=D0=B8=20'c?= =?UTF-8?q?v3/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv3/program.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index 300b4ce..47b85d5 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -1,6 +1,7 @@ #include #include #include +#include #define LENGTH 256 int main(){ @@ -9,7 +10,7 @@ int main(){ double x, cf,result = 0; fgets(line, 100, stdin); x = strtod(line, NULL); - cf1 = x; + cf1 = ceil(x); if(cf1 == 0 && line[0] != '\n'){ printf("Nepodarilo sa nacitat zaklad x\n"); return 1; @@ -19,7 +20,7 @@ int main(){ result = result * x + cf; fgets(line, 100, stdin); cf = strtod(line,NULL); - cf1 = cf; + cf1 = ceil(cf); if(cf1 == 0 && line[0] != '\n'){ printf("\nNepodarilo sa nacitat polynom na %d mieste.\n", cfIdx); return 1;