Изменил(а) на 'du3/program.c'

This commit is contained in:
Andrii Hermaniuk 2022-03-17 22:00:47 +00:00
parent bf0e5f2143
commit 296065bc0a

View File

@ -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;