标签:pen color include col for temp pac gif cin
#include<iostream> using namespace std; template<class T> T ploy(T *coeff,int n,const T&x){ T value=coeff[n]; for(int i=1;i<=n;i++) value=value*x+coeff[i-1];//你麻痹 return value; } int main() { int n,x; cin>>n>>x; int a[n+1]; for(int i=n;i>=0;i--) cin>>a[i]; cout<<ploy(a,n,x); }
利用递归计算多项式
标签:pen color include col for temp pac gif cin
原文地址:https://www.cnblogs.com/helloworld2019/p/10351137.html