Přidat „a1“

This commit is contained in:
Pavlo Tverdyi 2020-03-14 22:34:37 +00:00
parent 1d1236d726
commit 1200baf942

26
a1 Normal file
View File

@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int i,c;
double x;
double result=0;
scanf("%lF",&x);
double *array;
array = (double*) malloc(1000);
for(i=0,c=1;i<c;i++,c++){
int b = scanf("%lF",&array[i]);
if(b==EOF){
break;
}
}
for(int j=0 ;i>0; i--,j++){
printf("%.2F ",array[j]);
result+=array[i-1]*pow((double)x,j);
}
printf("%.2F",result);
free(array);
return 0;
}