收藏 分享(赏)

vb进制转换代码.doc

上传人:HR专家 文档编号:11561201 上传时间:2020-06-24 格式:DOC 页数:2 大小:69.50KB
下载 相关 举报
vb进制转换代码.doc_第1页
第1页 / 共2页
vb进制转换代码.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、Private Sub Command1_Click() Dim s As String, i As Integer, t As String, sum As Integer, j As Integer s = Text1 If Len(s) Mod 3 0 Then s = String(3 - Len(s) Mod 3, 0) & s For i = 1 To Len(s) Step 3 t = Mid(s, i, 3) sum = 0 For j = 1 To Len(t) 二进制到八进制 sum = sum + Mid(t, j, 1) * 2 (Len(t) - j) Next j

2、Text2 = Text2 & sum Next iEnd SubPrivate Sub Command2_Click() Dim s As String, i As Integer, t As String, sum As Integer, j As Integer s = Text3 If Len(s) Mod 4 0 Then s = String(4 - Len(s) Mod 4, 0) & s For i = 1 To Len(s) Step 4 t = Mid(s, i, 4) sum = 0 For j = 1 To Len(t) 二进制到十进制 sum = sum + Mid(

3、t, j, 1) * 2 (Len(t) - j) Next j Text4 = Text4 & sum Next iEnd SubPrivate Sub Command3_Click() Dim s As String, i As Integer, t As String, sum As Integer, j As Integer, s1 As String s = Text5 If Len(s) Mod 4 0 Then s = String(4 - Len(s) Mod 4, 0) & s For i = 1 To Len(s) Step 4 t = Mid(s, i, 4) sum = 0 二进制到十六进制 For j = 1 To Len(t) sum = sum + Mid(t, j, 1) * 2 (Len(t) - j) Next j If sum 9 Then s1 = Chr(sum + 55) Else s1 = sum Text6 = Text6 & s1 Next iEnd Sub

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 网络科技 > 计算机原理

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报