当前位置:网站首页>C output Fibonacci sequence
C output Fibonacci sequence
2022-07-23 12:59:00 【Amateur visionary】
One 、 What is Fibonacci series
Fibonacci sequence (Fibonacci sequence), Also called golden section series 、 Because mathematician Leonardo · Fibonacci (Leonardoda Fibonacci) Take rabbit breeding as an example , It is also called “ Rabbit Series ”
Two 、 Fibonacci sequence definition :
Simply speaking , Fibonacci sequence refers to a sequence like this 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89…
That is, the sequence from the first 3 A start , Each of these terms is equal to the sum of the first two terms .
3、 ... and 、 Use C# Realization of Fibonacci series
When we fully understand the definition of Fibonacci sequence , Then it can be implemented in programming language ( Sample selection C# Realize the output Fibonacci sequence , And press 5 That's ok 4 Column mode output )
using System;
namespace fibonacci
{
class Program
{
static void Main(string[] args)
{
int a = 1;
int b = 1;
int c = 0;
Console.WriteLine(" Fibonacci sequence :");
for(int i=1; i<=5; i++)
{
for (int j=1; j<= 4; j++)
{
Console.Write("{0}\t", a);
c = a + b;
a = b;
b = c;
}
Console.WriteLine();
}
Console.ReadKey();
}
}
}
边栏推荐
- 深度优先找出图中顶点U到顶点V的所有简单路径
- Overview of OpenSSL self visa process
- Unity3d+gameframework: resource analysis, resource dependency, circular dependency detection
- Analysis of Internet Protocol (II)
- 2020-09-20
- Hcip - first experiment
- Hcip ---- relevant knowledge points of GRE protocol, mGRE environment and OSPF Protocol
- C custom queue set
- Learning diary - (routing and switching technology) ACL access control list
- [database] basic theory
猜你喜欢

Routing extension configuration of OSPF and rip

STP 配置实例学习记录

Solution rapide: xshell ne peut pas glisser dans un dossier ou un paquet

查询交叉编译出的可执行文件依赖库

@Requiredargsconstructor annotation use

超好用的抓包工具tcpdump

Routing and interface technology -- Summary of direct network

Pod 拓扑约束

Hcip --- mGRE comprehensive experiment

DHCP second experiment
随机推荐
Article on the basic technology needed to build hybrid app
Build FRPC client in NAS [super brainless]
Unity3d HD rendering pipeline cannot play video on the model
C #: TOPK: take the largest 100 before 10000 numbers, and sort the heap
[database] basic theory
Hcip-hcia knowledge review (II)
超好用的抓包工具tcpdump
Explain the flow control mechanism and congestion control mechanism of TCP in detail
Nas里搭建Frpc客户端【超级无脑】
Prefix and leetcode2100. Suitable for bank robbery days
关于搭建Hybrid App所需要的基础技术一文
Square root cube root
RIP 配置实例学习记录
Quick solution: xshell can't drag into folders or software packages
Learning diary - (routing and switching technology) ACL access control list
C: stack stack source code, array stack, chain stack
Sword finger offer summary
Real questions required for Niuke interview [algorithm] summary of high-frequency TOP200 questions
Explain TCP segmentation and IP fragmentation in detail
快速解决:Xshell拖不进去文件夹或者软件包的问题