From 1fa182a7fa0aed52862bdfeceb4a1930a49339c3 Mon Sep 17 00:00:00 2001 From: Deinerovych Date: Wed, 16 Oct 2024 12:08:39 +0200 Subject: [PATCH] 23 --- cv3/program.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index b078612..a73be46 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -58,12 +58,12 @@ float pop() { void print_stack() { for (int i = 0; i <= stack_top; i++) { - if (i > 0) { + printf("%.2f", stack[i]); + if (i < stack_top) { printf(" "); } - printf("%.2f", stack[i]); } - printf("\n"); // Убираем лишний пробел перед переводом строки + printf("\n"); } int main() {