【vbs】1000到9999之间有多少个各位数字不同求该VBS,谢谢

来源:学生作业帮助网 编辑:作业帮 时间:2024/10/04 19:14:31
【vbs】1000到9999之间有多少个各位数字不同求该VBS,谢谢
x){0,qDC,ӷٱ鄖'{{Mt';zNyaN:/6,""} kj~ ]WQH/RHYP, ϴ5 CDX32K4 !а h|yyP ;msSa"% @[T$)⒢R@j^BfZQaR7[ 6z,b\_nqzR~H2v?mhbjl [5kyٴ6OyS7:EExø(@#MR!?x6A_\Nn

【vbs】1000到9999之间有多少个各位数字不同求该VBS,谢谢
【vbs】1000到9999之间有多少个各位数字不同
求该VBS,谢谢

【vbs】1000到9999之间有多少个各位数字不同求该VBS,谢谢
dim num,c,i,bool,chr
for c=1000 to 9999
for i=1 to 3
if instr(instr(1,c,mid(c,i,1))+1,c,mid(c,i,1))0 then
bool=false
exit for
else
bool=true
end if
next
if bool then num=num+1:chr=chr & c & vbCr
next
msgbox num
msgbox chr
总共4536个
第二种方法,要简单点,.
dim num,c,i,bool,chr,arr()
for c=1000 to 9999
redim arr(10)
for i=1 to 4
if arr(mid(c,i,1))=true then
bool=false
exit for
else
arr(mid(c,i,1))=true
bool=true
end if
next
if bool then num=num+1:chr=chr & c & vbCr
next
msgbox num
msgbox chr