Home > php教程 > php手册 > php实现斐波那契数列的简单写法

php实现斐波那契数列的简单写法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:20:06
Original
2335 people have browsed it

这篇文章主要介绍了php实现斐波那契数列的简单写法,需要的朋友可以参考下

斐波那契数列是非常常见的一类数列,,其数学定义为:F0=1,F1=1,Fn=F(n-1)+F(n-2)(n>=2,n∈N*)。本文就用php来简单实现斐波那契数列,代码十分简洁易懂,如下所示:

至此就实现了Fn=F(n-1)+F(n-2)中n在100以内的斐波那契数列的显示输出。

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template