From a0a40567d34cba7ad2ac79758cd4e8764e4ce2ea Mon Sep 17 00:00:00 2001 From: Vladyslav Korzun Date: Mon, 6 Mar 2023 17:06:24 +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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/du3/program.c b/du3/program.c index dd930f2..9fb6dfd 100644 --- a/du3/program.c +++ b/du3/program.c @@ -20,11 +20,12 @@ int main(){ int pos = -1; //float p = 0; while(stop == 0){ - r = fgets(riadok,LINE_SIZE,stdin); - pos++; + r = fgets(riadok,LINE_SIZE,stdin); if(feof(stdin)){ break; } + pos++; + if (r == NULL || !isdigit(*r) || *r == EOF || feof(stdin)) { //printf("%d", *r); if(*r == 10){