diff --git a/du3/program b/du3/program index ce4f779..dcd4762 100755 Binary files a/du3/program and b/du3/program differ diff --git a/du3/program.c b/du3/program.c index bab8fe0..c852917 100644 --- a/du3/program.c +++ b/du3/program.c @@ -1,21 +1,18 @@ #include int main(){ - int vxod[999]; + float vxod[999]; int i = 0; - int result = 0; + float result = 0; while(1){ - int value = 0; - int r = scanf("%d",&value); + float value = 0; + float r = scanf("%f", &value); if(r == 1){ vxod[i++] = value; - }else if(r < 1 && vxod[0] < 1){ - printf("Vysledok je: 0.60\n"); - break; }else{ for(int a = 1; a < i; a++) result = vxod[0] * result + vxod[a]; - printf("Vysledok je: %d.00\n", result); + printf("Vysledok je: %.2f\n", result); break; } }