[Paybyte series (Fibonacci series)] and paybyte Series

Source: Internet
Author: User

[Paybyte series (Fibonacci series)] and paybyte Series

/* Note: Fibonacci is a european mathematician in the 1200 s. In his work, he once mentioned that if a rabbit produces a rabbit every month, it will also start to produce in a month. At first there was only one rabbit, two rabbits in a month, three rabbits in two months, and five rabbits in three months )...... If you don't quite understand this example, let's take a picture. Note that the new Bunny will only be put into production in a month's growth period. A similar principle can also be used for plant growth. This is the Fibonacci series, the general habit is called the toll series, such as:, 89 solution: we can talk about the charge series is defined as the following: Fn = Fn-1 + Fn-2, n> 1 Fn = n, n = 0 or 1 */# include <stdio. h> # include <stdlib. h> # define N 20int main (void) {int Fib [N] = {0}; int I; Fib [0] = 0; Fib [1] = 1; for (I = 2; I <N; I ++) Fib [I] = Fib [I-2] + Fib [I-1]; for (I = 0; I <N; I ++) {printf ("% d", Fib [I]); printf ("");} printf ("\ n"); return 0 ;}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.