From 49fef5d3693727cfac0f8ef89588d445be9909b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Korpesio?= Date: Wed, 20 Oct 2021 11:26:28 +0200 Subject: [PATCH] prvy --- cv3/program.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cv3/program.c b/cv3/program.c index a099af5..f01429f 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -30,6 +30,11 @@ int main() { } if (line[0] == '+' || line[0] == '-' || line[0] == '*' || line[0] == '/') { input =+ 2; + if (a == 1){ + printf("no enough operands"); + vys = 1; + break; + } if (line[0] == '+') { number[a - 2].cislo = number[a - 2].cislo + number[a - 1].cislo; a--;