27 lines
502 B
Plaintext
27 lines
502 B
Plaintext
#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;
|
|
}
|