Přidat „a1“
This commit is contained in:
parent
1d1236d726
commit
1200baf942
26
a1
Normal file
26
a1
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user