Изменил(а) на 'du3/program.c'
This commit is contained in:
parent
bf0e5f2143
commit
296065bc0a
@ -29,23 +29,23 @@ int main(){
|
||||
char *end = NULL;
|
||||
char *start = pol;
|
||||
x=strtof(start,&end);
|
||||
x=round(x*100)/100;
|
||||
|
||||
start=end;
|
||||
|
||||
float num=0;
|
||||
for(int i=0;i<koef;i++){
|
||||
float p=1, n=0;
|
||||
n=strtof(start,&end);
|
||||
if(n)start=end;
|
||||
else break;
|
||||
n=round(n*100)/100;
|
||||
start=end;
|
||||
|
||||
for(int idx=(koef-i)-1;idx>0;idx--)p*=x;
|
||||
|
||||
num+=p*n;
|
||||
}
|
||||
|
||||
num*=100;
|
||||
num=round(num);
|
||||
num/=100;
|
||||
num=round(num*100)/100;
|
||||
|
||||
printf("Vysledok je: %.2f\n", num);
|
||||
return EXIT_SUCCESS;
|
||||
|
Loading…
Reference in New Issue
Block a user