DSA
This commit is contained in:
parent
56592506ba
commit
4f0fdefc55
BIN
du3/program
BIN
du3/program
Binary file not shown.
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user