# 关于算法的一些想法

5 篇文章 0 订阅

Dim a As Single, Total As Single, b As Integer
a = Text1.Text: b = Text2.Text: Total = 1
Do While b <> 0
Total = Total * a
b = b - 1
Loop
Text3.Text = Total

Private Sub Command1_Click()
Dim a As Single, Total As Single
Dim b As Integer, n As Integer

a = Text1.Text
Total = Text1.Text
b = Text2.Text

Select Case b
Case 0
Total = 1
Case Is < 0
MsgBox "非法数据", vbOKOnly, "出错"
Text3.Text = ""
Exit Sub
Case Else
For n = 1 To b - 1
Total = Total * a
Next
End Select
Text3.Text = Total
End Sub

Dim a As Double, b As Integer, c As Double
a = Text1.Text: b = Text2.Text
c = a ^ b
Text3.Text = c

Function reversestring(revstr As String) As String
Dim doreverse As Long
reversestring = ""
For doreverse = Len(revstr) To 1 Step -1
reversestring = reversestring & Mid\$(revstr, doreverse, 1)
Next
End Function

Text2.Text = StrReverse(Text1.Text)

• 0
点赞
• 0
收藏
觉得还不错? 一键收藏
• 0
评论
10-31 112
05-13 4337
11-23 2万+
01-05 6650
12-13
05-30 9021
10-17 1108
01-15 5万+

### “相关推荐”对你有帮助么？

• 非常没帮助
• 没帮助
• 一般
• 有帮助
• 非常有帮助

1.余额是钱包充值的虚拟货币，按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载，可以购买VIP、付费专栏及课程。