33位进制如何换算?如何设置公式
答案:1 悬赏:30 手机版
解决时间 2021-01-09 07:26
- 提问者网友:听门外雪花风
- 2021-01-08 21:19
33位进制如何换算?如何设置公式
最佳答案
- 五星知识达人网友:第幾種人
- 2021-01-08 22:40
33进制规则是:0、1、2、3、4、5、6、7、8、9、A、C、D、E、F、G、H、J、K、L、M、N、P、Q、R、S、T、V、W、X、Y、Z、10,字母:I、O、U不用;
VBA代码
Function tenTo33(x As Long) As String
Dim i As Integer
Dim tmp As Long
Dim start As Boolean
tmp = x
Dim xStr(0 To 32) As String
For i = 0 To 32
Select Case i
Case 0 To 9: xStr(i) = Chr(i + 48)
Case 10 To 17: xStr(i) = Chr(i + 55)
Case 18 To 22: xStr(i) = Chr(i + 56)
Case 23 To 27: xStr(i) = Chr(i + 57)
Case 28 To 32: xStr(i) = Chr(i + 58)
End Select
Next i
For i = 10 To 1 Step -1
If Int(tmp / 33 ^ i) > 0 Then
start = True
End If
If start Then
tenTo33 = tenTo33 & xStr(Int(tmp / 33 ^ i))
If Int(tmp / 33 ^ i) > 0 Then
tmp = tmp - Int(tmp / 33 ^ i) * 33 ^ i
End If
End If
Next i
tenTo33 = tenTo33 & xStr(tmp)
End Function
VBA代码
Function tenTo33(x As Long) As String
Dim i As Integer
Dim tmp As Long
Dim start As Boolean
tmp = x
Dim xStr(0 To 32) As String
For i = 0 To 32
Select Case i
Case 0 To 9: xStr(i) = Chr(i + 48)
Case 10 To 17: xStr(i) = Chr(i + 55)
Case 18 To 22: xStr(i) = Chr(i + 56)
Case 23 To 27: xStr(i) = Chr(i + 57)
Case 28 To 32: xStr(i) = Chr(i + 58)
End Select
Next i
For i = 10 To 1 Step -1
If Int(tmp / 33 ^ i) > 0 Then
start = True
End If
If start Then
tenTo33 = tenTo33 & xStr(Int(tmp / 33 ^ i))
If Int(tmp / 33 ^ i) > 0 Then
tmp = tmp - Int(tmp / 33 ^ i) * 33 ^ i
End If
End If
Next i
tenTo33 = tenTo33 & xStr(tmp)
End Function
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯