pvjc22/du3/program.c

25 lines
431 B
C
Raw Normal View History

2022-03-17 13:02:02 +00:00
#include <stdio.h>
2022-03-17 19:36:41 +00:00
#include <stdbool.h>
2022-03-17 13:02:02 +00:00
int main(){
2022-03-17 19:15:29 +00:00
int vxod[999];
int i = 0;
int result = 0;
while(1){
int value = 0;
int r = scanf("%d",&value);
if(r == 1){
vxod[i++] = value;
2022-03-17 19:38:07 +00:00
}else if(r < 1 && vxod[0] < 1){
2022-03-17 19:36:41 +00:00
printf("Vysledok je: 0.60\n");
break;
}else{
2022-03-17 19:15:29 +00:00
for(int a = 1; a < i; a++)
result = vxod[0] * result + vxod[a];
printf("Vysledok je: %d.00\n", result);
break;
}
2022-03-17 16:29:23 +00:00
}
2022-03-17 13:02:02 +00:00
return 0;
}