round fix
This commit is contained in:
parent
fc8b19653c
commit
8a84024931
@ -13,15 +13,13 @@ int main() {
|
||||
opakovania++;
|
||||
}
|
||||
|
||||
float result = pole[1];
|
||||
float vysledok = pole[1];
|
||||
|
||||
for (int i = 2; i < opakovania; ++i) {
|
||||
result = result * pole[0] + pole[i];
|
||||
vysledok = vysledok * pole[0] + pole[i];
|
||||
}
|
||||
|
||||
result = ((int)(result * 100 + 0.5)) / 100.0;
|
||||
|
||||
printf("Vysledok je: %.2f\n", result);
|
||||
printf("Vysledok je: %.2f\n", vysledok);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user