From e51eb9632c2961bdc5bd673aad034eaa7fa0908e Mon Sep 17 00:00:00 2001 From: ak643du Date: Fri, 8 Mar 2024 01:37:56 +0100 Subject: [PATCH] Initialization --- cv3/program.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index 48d375f..0a4f81c 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -12,12 +12,13 @@ int main() { while (count < SIZE) { if (scanf("%lf", &input) != 1) { - if (count == 0){ - printf("Nepodarilo sa nacitat zaklad x\n"); + if (scanf("%c", &input) == 1) { + if (count == 0){ + printf("Nepodarilo sa nacitat zaklad x\n"); + return 0; + } + printf("Nepodarilo sa nacitat polynom na %d mieste.\n", count); return 0; - } - printf("Nepodarilo sa nacitat polynom na %d mieste.\n", count); - return 0; } coefs[count] = input; count++;