diff --git a/du3/program b/du3/program index a239296..2f8369d 100755 Binary files a/du3/program and b/du3/program differ diff --git a/du3/program.c b/du3/program.c index b3a06e4..b6f470e 100644 --- a/du3/program.c +++ b/du3/program.c @@ -4,7 +4,7 @@ int main(){ int result = 0; int value = 0; int vxod[999]; - //int a = 0; + int a = 0; //int b = 999; for(int i = 0; i < 999; i++) vxod[i] = 0; @@ -12,8 +12,11 @@ int main(){ scanf("%d",&value); vxod[i] = value; } - - for(int i = 1; i < 999; i++){ + for(int i = 0; i < 999; i++){ + if(vxod[i] > 0) + a++; + } + for(int i = 1; i < a; i++){ result = vxod[0] * result + vxod[i]; } printf("Vysledok je: %d.00\n", result);