vb进制转换代码
摘要:PrivateSubCommand1_Click()DimsAsString,iAsInteger,tAsString,sumAsInteger,jAsIntegers=Text1IfLen(s)Mod3<>0Thens=String(3-Len(s)Mod3,"0")&sFori=1ToLen(s)Step3t=Mid(s,i,3)sum=0Forj=1ToLen(t)'二进制到八进制sum=sum+Mid(t,j,1)*2^(Len(t)-j)NextjText2=Text2&sumNextiEndSubPrivateSubCommand2_Click()DimsAsString,iAsInteger,tAsString,sumAsInteger,jAsIntegers=Text3IfLen(s)Mod4<>0Thens=String(4-Len(s)Mod4,"0")&sFori=1ToLen(s)Step4t=Mid(s,i,4)sum=0Forj=1ToLen(t)'二进制到十进制sum=sum+Mid(t,j,1)*2^(Len(t)-j)NextjText4=Text4&sumNextiEndSubPrivateSubCommand3_Click()DimsAsString,iAsInteger,tAsString,sumAsInteger,jAsInteger,s1AsStrings=Text5IfLen(s)Mod4<>0Thens=String(4-Len(s)Mod4,"0")&sFori=1ToLen(s)Step4t=Mid(s
温馨提示:当前文档最多只能预览
5 页,若文档总页数超出了
5 页,请下载原文档以浏览全部内容。
本文档由 匿名用户 于 2020-11-04 06:59:31上传分享