求vb小程序代码

求12^8的个位数、十位数和百位数
2025-01-01 11:19:54
推荐回答(2个)
回答1:

Private Sub Command1_Click()
Print "个位数:" & Right(12 ^ 8, 1), "十位数:" & Mid(12 ^ 8, Len(CStr(12 ^ 8)) - 1, 1), "百位数" & Mid(12 ^ 8, Len(CStr(12 ^ 8)) - 2, 1)
End Sub

回答2:

Dim s As Long
Dim ge As Integer
Dim shi As Integer
Dim bai As Integer

Private Sub Command1_Click()
s = 12 ^ 8
ge = s Mod 10
shi = (s Mod 100) \ 10
bai = (s Mod 1000) \ 100
End Sub