有一数列:1、1、2、3、5、8、13、21……写一个过程以求出这个数列的前100项之和 VB求写个程序

zhuo306 1年前 已收到1个回答 举报

采芒果的姑娘 花朵

共回答了23个问题采纳率:82.6% 举报

斐波那契数列
第100项为354224848179261915075
前100项和为927372692193078999175
计算结果如下:
.
098.135301852344706746049
S098 = 354224848179261915074
099.218922995834555169026
S099 = 573147844013817084100
100.354224848179261915075
S100 = 927372692193078999175
dim a as longcurrency
dim b as longcurrency
dim c as longcurrency
dim s as longcurrency
dim i as longcurrency
a = 1
b = 1
s = 0
for i = 3 to 100
c = a + b
s = s + c
a = b
b = c
next
msgbox s

1年前

5
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.026 s. - webmaster@yulucn.com