CODE: [Copy to clipboard]
do
a=0
do until a=1
randomize
sjs=int(rnd*999999999999)
n=inputbox("请输入一个小于1000000000000的整数:","读数",sjs)
if n="" then wscript.quit
if n="0" then exit do
if IsNumeric(n)=false or instr(n,".")<>0 then
msgbox "您输入的不是一个整数,请重新输入!",16+4096,"错误"
elseif left(n,1)=0 then
msgbox "输入错误,您输入的数不能以“0”打头,请重新输入!",16+4096,"错误"
elseif len(n)>12 then
msgbox "您输入的数不能大于“999999999999”,请重新输入!",16+4096,"错误"
else
a=1
end if
loop
y=n
sz=split("0,1,2,3,4,5,6,7,8,9",",")
hz=split("零,一,二,三,四,五,六,七,八,九",",")
for i=0 to 9
n=replace(n,sz(i),hz(i))
next
dw="千百十亿千百十万千百十"
h=len(n)
for i=1 to h
s=s & mid(n,i,1) & mid(dw,12-h+i,1)
next
m=split("零十,零百,零千,零万,零亿",",")
do until instr(s,m(0))=0 and instr(s,m(1))=0 and instr(s,m(2))=0and instr(s,m(3))=0 and instr(s,m(4))=0
s=replace(s,m(0),"零")
s=replace(s,m(1),"零")
s=replace(s,m(2),"零")
s=replace(s,m(3),"万零")
s=replace(s,m(4),"亿零")
loop
s=replace(s,"亿万","亿")
do until instr(s,"零零")=0
s=replace(s,"零零","零")
loop
if len(n)<>1 and right(s,1)="零" then s=left(s,len(s)-1)
if left(s,2)="一十" then s=right(s,len(s)-1)
on error resume next
i=0
do
i=instr(i+1,s,"零")
if mid(s,i+2,1)="千" then s=replace(s,mid(s,i,3),mid(s,i+1,2))
loop until i=0
jx=msgbox ("您输入的数是:" & y & vbcrlf & "读为:" & s & vbcrlf & "是否继续?",vbyesno+32+4096,"系统提示")
if jx=vbno then wscript.quit
s=""
loop
[CODE: [Copy to clipboard]
do
a=0
do until a=1
randomize
sjs=int(rnd*999999999999)
n=inputbox("请输入一个小于1000000000000的整数:","读数",sjs)
if n="" then wscript.quit
if n="0" then exit do
if IsNumeric(n)=false or instr(n,".")<>0 then
msgbox "您输入的不是一个整数,请重新输入!",16+4096,"错误"
elseif left(n,1)=0 then
msgbox "输入错误,您输入的数不能以“0”打头,请重新输入!",16+4096,"错误"
elseif len(n)>12 then
msgbox "您输入的数不能大于“999999999999”,请重新输入!",16+4096,"错误"
else
a=1
end if
loop
y=n
sz=split("0,1,2,3,4,5,6,7,8,9",",")
hz=split("零,一,二,三,四,五,六,七,八,九",",")
for i=0 to 9
n=replace(n,sz(i),hz(i))
next
dw="千百十亿千百十万千百十"
h=len(n)
for i=1 to h
s=s & mid(n,i,1) & mid(dw,12-h+i,1)
next
m=split("零十,零,零百,零,零千,零,零零零,零,零零,零,零亿,亿,零万,万,亿万,亿",",")
for i=0 to 14 step 2
s=replace(s,m(i),m(i+1))
next
if len(n)<>1 and right(s,1)="零" then s=left(s,len(s)-1)
if left(s,2)="一十" then s=right(s,len(s)-1)
jx=msgbox ("您输入的数是:" & y & vbcrlf & "读为:" & s & vbcrlf & "是否继续?",vbyesno+32+4096,"系统提示")
if jx=vbno then wscript.quit
s=""
loop
[