From a3104a6d6839817bb326c8b905584526512bcce4 Mon Sep 17 00:00:00 2001 From: Vladyslav Korzun Date: Mon, 6 Mar 2023 17:19:41 +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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/du3/program.c b/du3/program.c index a29f16e..6154ff3 100644 --- a/du3/program.c +++ b/du3/program.c @@ -20,7 +20,13 @@ int main(){ int pos = -1; //float p = 0; while(stop == 0){ + if(feof(stdin)){ + break; + } r = fgets(riadok,LINE_SIZE,stdin); + if(feof(stdin)){ + break; + } pos++; if (r == NULL || !isdigit(*r)) { //printf("%d", *r); @@ -68,4 +74,4 @@ int main(){ vysl = mass[1]; } printf("Vysledok je: %.2f\n", vysl); -} \ No newline at end of file +}