[求助]关于数列的编程
请问怎样编写"每个苹果0.8元,第一天买2个苹果,第二天开始,每天买前一天的2倍,直至购买的苹果个数达到不超过100的最大值。求每天平均花多少钱?"这个程序。
dim sum as float
dim anpcount as integer
dim daycount as integer
dim everage as float
anpcount=2
daycount=1
while anpcount<100
anpcount=anpcount + 2 * anpcount
daycount=daycount + 1
wend
everage=anpcont * 0.8/daycount
大概是这样的,不知道语法对不对,你试试吧