Problem1126--多项式求值

1126: 多项式求值

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

函数接口定义: double f( int n, double a[], double x ); 其中n是多项式的阶数,a[]中存储系数,x是给定点。函数须返回多项式f(x)的值。 裁判测试程序样例: #include #define MAXN 10 double f( int n, double a[], double x ); int main() { int n, i; double a[MAXN], x; scanf(

Input

第一行是多项式的阶数和x的值,第二行是各个系数的值

Output

第一行是多项式的阶数和x的值,第二行是各个系数的值

Sample Input Copy

2 1.1
1 2.5 -38.7

Sample Output Copy

-43.1

Source/Category