兔兔

  • 主题发起人 主题发起人 sean
  • 开始时间 开始时间

sean

新手上路
注册
2002-09-16
消息
1,072
荣誉分数
0
声望点数
0
the smartest person on the earth

have any shortcut

1*( 1.07^25 + 1.07^24 + 1.07^23 + .... ) = :confused:
 
等比数列的和啊.有公式的.
 
1*( 1.07^25 + 1.07^24 + 1.07^23 + .... ) = turkey solution
 
我想知道结果
 
1代表单位1,ZT
 
代码:
 10 let b = 1.07
 20 let sum = 0
 30 for x = 25 to 0 step -1
 40 let sum0 = 1
 50 for y = 1 to x
 60 let sum0 = sum0 * b
 70 next y
 80 let sum = sum + sum0
 90 next x
100 print "You got: "; sum
 
( x^(y+1) - 1 ) / ( X - 1 )
or
1 * ( 1.07^(25+1) - 1 ) / (1.07 -1)
 
最初由 shusheng 发布
代码:
 10 let b = 1.07
 20 let sum = 0
 30 for x = 25 to 0 step -1
 40 let sum0 = 1
 50 for y = 1 to x
 60 let sum0 = sum0 * b
 70 next y
 80 let sum = sum + sum0
 90 next x
100 print "You got: "; sum

Wo Kao, BASIC a. I used to use it lot mayny many years ago.
 
后退
顶部