代码:PrivateSubCommand1_Click()DimxAsLongx=Val(InputBox("请输入一个十进制数:"))Print"转换为八进制的结果是:",Str(DEC_to_OCT(x)
)EndSubPublicFunctionDEC_to_OCT(DecAsLong)AsStringDEC_to_OCT=""DoWhileDec>0DEC_to_OCT=DecMod8&DEC_to_OCTDec=Dec8LoopEndFunction图:
代码:PrivateSubCommand1_Click()DimxAsLongx=Val(InputBox("请输入一个十进制数:"))Print"转换为八进制的结果是:",Str(DEC_to_OCT(x)
)EndSubPublicFunctionDEC_to_OCT(DecAsLong)AsStringDEC_to_OCT=""DoWhileDec>0DEC_to_OCT=DecMod8&DEC_to_OCTDec=Dec8LoopEndFunction图: