From 054ef15374406f64c27af4a13025cf1df69150b3 Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Fri, 22 Oct 2021 11:58:39 +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'cv3/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv3/program.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index aee9825..0ee4298 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -53,10 +53,10 @@ bool calculatorLogic(char buffer[SIZE][SIZE]){ for(int i = currentlyInBuffer-2; currentlyInBuffer > i; currentlyInBuffer--) memset(buffer[currentlyInBuffer], '\0', SIZE); - gcvt(temporaryDecimal, 10, buffer[currentlyInBuffer++]); + gcvt(temporaryDecimal, 10, buffer[currentlyInBuffer]); - for(int i = 0; i < currentlyInBuffer; i++){ - if(i == currentlyInBuffer-1) + for(int i = 0; i <= currentlyInBuffer; i++){ + if(i == currentlyInBuffer) printf("%0.2f \n", roundf(atof(buffer[i]) * 100) / 100); else printf("%0.2f ", roundf(atof(buffer[i]) * 100) / 100);