...34... 求第30位数是多少, 用递归算法实现(C#编写)。

发布网友 发布时间:2024-10-24 08:52

我来回答

5个回答

热心网友 时间:2024-10-28 16:41

int f(int a){
if(a == 1 || a == 2){
return 1;
}
else{
return f(a-1) + f(a-2);
}
}

热心网友 时间:2024-10-28 16:41

后面的数是前面两个数相加
不过只会VB。。。。

热心网友 时间:2024-10-28 16:44

832040

热心网友 时间:2024-10-28 16:48

1、
1、
2、
3、
5(第五位,下略写)、
8、
13、
21、
34、
55(十)、

144、
233、
377、
610(十五)、
987、
1597、
2584、
4181、
6765(二十)、
10946、
17711、
28657、
46368、
75025(二十五)、
121393、
1918、
317811、
512229、
832040(三十)

则第三十位是:
832040

热心网友 时间:2024-10-28 16:40

int falgeA = 1;
int falgeB = 1;
int i=1;
while(true)
{
if(i==30)
{
return;
}
falgeA = falgeA + falgeB;
}

热心网友 时间:2024-10-28 16:47

int f(int a){
if(a == 1 || a == 2){
return 1;
}
else{
return f(a-1) + f(a-2);
}
}

热心网友 时间:2024-10-28 16:45

1、
1、
2、
3、
5(第五位,下略写)、
8、
13、
21、
34、
55(十)、

144、
233、
377、
610(十五)、
987、
1597、
2584、
4181、
6765(二十)、
10946、
17711、
28657、
46368、
75025(二十五)、
121393、
1918、
317811、
512229、
832040(三十)

则第三十位是:
832040

热心网友 时间:2024-10-28 16:47

后面的数是前面两个数相加
不过只会VB。。。。

热心网友 时间:2024-10-28 16:44

int falgeA = 1;
int falgeB = 1;
int i=1;
while(true)
{
if(i==30)
{
return;
}
falgeA = falgeA + falgeB;
}

热心网友 时间:2024-10-28 16:42

832040

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com