From 296065bc0aa052cdc00689d10d9775123c9d2363 Mon Sep 17 00:00:00 2001 From: Andrii Hermaniuk Date: Thu, 17 Mar 2022 22:00:47 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'du3/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du3/program.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/du3/program.c b/du3/program.c index f22d8db..e87a1cf 100644 --- a/du3/program.c +++ b/du3/program.c @@ -29,23 +29,23 @@ int main(){ char *end = NULL; char *start = pol; x=strtof(start,&end); + x=round(x*100)/100; + start=end; float num=0; for(int i=0;i0;idx--)p*=x; num+=p*n; } - num*=100; - num=round(num); - num/=100; + num=round(num*100)/100; printf("Vysledok je: %.2f\n", num); return EXIT_SUCCESS;