From 68a7982efc5846c9a0d5a93c9033ddc1107da2a0 Mon Sep 17 00:00:00 2001 From: Peter Sabol Date: Wed, 9 Mar 2022 08:09:09 +0000 Subject: [PATCH] Update 'du2/program.c' --- du2/program.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/du2/program.c b/du2/program.c index ca1702a..53f4063 100644 --- a/du2/program.c +++ b/du2/program.c @@ -3,19 +3,17 @@ #define VELKOST_POLA 52 int main(){ - //int i=1; + int i=1; int value = 0; + memset(pole,0,VELKOST_POLA * sizeof(int)); int r = scanf("%d",&value); - if (r == 1){ - printf("Úspešne som načítal hodnotu %d\n",value); + for(r<=value){ + + r++; + i++ } - else { - printf("Načítanie sa nepodarilo. V premennej value ostala pôvodná hodnota. \n"); - return; - } + printf("Úspešne som načítal hodnotu %d\n",i); // int pole[VELKOST_POLA]; //int vysledky[VELKOST_POLA] - //memset(pole,0,VELKOST_POLA * sizeof(int)); - //for() return 0; } \ No newline at end of file