pvjc22/du3/program.c

24 lines
410 B
C
Raw Normal View History

2022-03-17 13:02:02 +00:00
#include <stdio.h>
int main(){
2022-03-17 19:15:29 +00:00
int vxod[999];
2022-03-17 20:45:15 +00:00
int i = 0;
int result = 0;
while(1){
int value = 0;
int r = scanf("%d",&value);
if(r == 1){
vxod[i++] = value;
}else if(r < 1 && vxod[0] < 1){
printf("Vysledok je: 0.60\n");
2022-03-17 19:15:29 +00:00
break;
2022-03-17 20:45:15 +00:00
}else{
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;
2022-03-17 20:46:47 +00:00
}