如何求该代数式的值?
已知条件:num1>=1 且 num1<=25
num2>=1 且 num2<=25
num3>=1 且 num3<=25
num4>=1 且 num4<=25
如果该等式成立:
i = num1 + num2 * 25 + num3 * 25 * 25 + num4 * 25 * 25 * 25
如何求:num1、num2、num3、num4的值?
PS:这个等式把我绕晕了,求解。
Private Sub Form_Load() '公式:i = num1 + num2 * 25 + num3 * 25 * 25 + num4 * 25 * 25 * 25 Dim i As Long i = 25 num4 = Int(i / (25 * 25 * 25)) num3 = Int((i - num4 * 25 * 25 * 25) / (25 * 25)) num2 = Int((i - num4 * 25 * 25 * 25 - num3 * 25 * 25) / 25) num1 = i - num4 * 25 * 25 * 25 - num3 * 25 * 25 - num2 * 25 'num1 或者写成 'num1 = i Mod 25 Debug.Print num1 & " " & num2 & " " & num3 & " " & num4 End Sub
[此贴子已经被作者于2022-9-17 13:58编辑过]
[此贴子已经被作者于2022-9-18 13:35编辑过]
Function GetStr(Num) Select Case Num Case 1: GetStr = "A" Case 2: GetStr = "B" Case 3: GetStr = "C" Case 4: GetStr = "D" Case 5: GetStr = "E" Case 6: GetStr = "F" Case 7: GetStr = "G" Case 8: GetStr = "H" Case 9: GetStr = "I" Case 10: GetStr = "J" Case 11: GetStr = "K" Case 12: GetStr = "L" Case 13: GetStr = "M" Case 14: GetStr = "N" Case 15: GetStr = "O" Case 16: GetStr = "P" Case 17: GetStr = "Q" Case 18: GetStr = "R" Case 19: GetStr = "S" Case 20: GetStr = "T" Case 21: GetStr = "U" Case 22: GetStr = "V" Case 23: GetStr = "W" Case 24: GetStr = "X" Case 25: GetStr = "Y" End Select End Function
[此贴子已经被作者于2022-9-19 00:57编辑过]