This commit is contained in:
Yaroslav Orlianskyi 2022-03-18 11:52:18 +01:00
parent 56592506ba
commit 4f0fdefc55
2 changed files with 5 additions and 8 deletions

Binary file not shown.

View File

@ -1,21 +1,18 @@
#include <stdio.h>
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;
}
}