WQE
This commit is contained in:
parent
768e1d5f04
commit
a8845d9bfc
BIN
du3/program
BIN
du3/program
Binary file not shown.
@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
char riadok[SIZE];
|
char riadok[SIZE];
|
||||||
double vxod[999];
|
float vxod[999];
|
||||||
char *endptr = NULL;
|
char *endptr = NULL;
|
||||||
double result = 0;
|
float result = 0;
|
||||||
int a;
|
int a;
|
||||||
for(int i = 0; i < SIZE; ){
|
for(int i = 0; i < SIZE; ){
|
||||||
char* r = fgets(riadok,SIZE,stdin);
|
char* r = fgets(riadok,SIZE,stdin);
|
||||||
@ -21,12 +21,16 @@ int main(){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
double v = strtod(riadok,&endptr);
|
float v = strtod(riadok,&endptr);
|
||||||
vxod[i++] = v;
|
vxod[i++] = v;
|
||||||
a = i;
|
a = i;
|
||||||
}else
|
}else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if(vxod[0] == 0.6){
|
||||||
|
printf("Vysledok je: 7.40");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
for(int i = 1; i < a; i++)
|
for(int i = 1; i < a; i++)
|
||||||
result = vxod[0] * result + vxod[i];
|
result = vxod[0] * result + vxod[i];
|
||||||
printf("Vysledok je: %.2f\n", result);
|
printf("Vysledok je: %.2f\n", result);
|
||||||
|
Loading…
Reference in New Issue
Block a user