| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2020-5-5 |
| 在线时间 | 41 小时 |
- 梦石
- 0
- 星屑
- 60
- 在线时间
- 41 小时
- 注册时间
- 2008-3-5
- 回帖
- 1992
|
发表于 2008-9-10 20:51:24
|
显示全部楼层
Dim i As Long
If stairnum = 1 Then
methodn = 1
ReDim steps(1 To methodn)
steps(1) = 1
End If
If stairnum = 2 Then
methodn = 1
ReDim steps(1 To methodn)
steps(1) = 11
End If
If stairnum = 3 Then
methodn = 2
ReDim steps(1 To methodn)
steps(1) = 111
steps(2) = 3
End If
If stairnum > 3 Then
Dim a() As String, b() As String, methoda As Long, methodb As Long
upstairs stairnum - 1, a, methoda ’递归调用
upstairs stairnum - 3, b, methodb '递归调用
ReDim steps(methoda + methodb)
For i = 1 To methoda
steps(i) = 1 & a(i)
Next
For i = 1 To methodb
steps(i + methoda) = 3 & b(i)
Next
methodn = methoda + methodb
End If
End Sub 系统信息:本贴获得楼主认可,66RPG感谢您的热情解答~ |
|