From 4aef4e93c7bdfcdf957e6c7a2ebe29fd419205e6 Mon Sep 17 00:00:00 2001 From: Vladyslav Korzun Date: Mon, 6 Mar 2023 18:54:18 +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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/du3/program.c b/du3/program.c index ced3a6e..5a226bc 100644 --- a/du3/program.c +++ b/du3/program.c @@ -21,18 +21,25 @@ int main(){ //float p = 0; while(stop == 0){ r = fgets(riadok,LINE_SIZE,stdin); + if(feof(stdin)){ + stop = 1; + r2 = atof(riadok); + mass[i] = r2; + i++; + + } pos++; - if (r == NULL || !isdigit(*r) || feof(stdin)) { + if (r == NULL || !isdigit(*r)) { //printf("%d", *r); if(*r == 10){ stop = 1; } - if(feof(stdin)){ + /*if(feof(stdin)){ stop = 1; r2 = atof(riadok); mass[i] = r2; i++; - } + }*/ else{ if(pos > 0){ printf("Nepodarilo sa nacitat polynom na %d mieste.\n", pos);