C++递归
LKY111
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
用递归求i的平方,再求和
#include using namespace std; int f(int); int main() { int n; cin>>n; cout } int f(int n) { int x; if(n==1) x=1; else x=n*n+f(n-1); return x; }原创 2015-02-03 16:32:32 · 3581 阅读 · 0 评论 -
用递归方法求n阶勒让德多项式的值(C++)
#include using namespace std; float p(float,float); int main() { float n,x; cin>>n>>x; cout return 0; } float p(float n,float x) { float f; if(n==0) f=1; else if(n==1) f=x; else if(n>原创 2015-02-03 16:13:08 · 3800 阅读 · 0 评论
分享