用VB写出所有三位数

来源:百度知道 编辑:UC知道 时间:2024/06/03 17:13:05
包括0-9的所有数字的组合。在线等~急用啊。。。
前面有问题。可能是我写的不清楚,需要的是所有的“三位数以内”
包括 001 00 059 01的这些。

'输出一位数

for i=0 to 9
print i
next

'输出两位数

for i=0 to 9
print "0" & i
next
for i=10 to 99
print i
next

'输出三位数

for i=0 to 9
print "00" & i
next
for i=10 to 99
print "0" & i
next

for i=100 to 999
print i
next

这样你得到了所有三位以内的数串,还好你要的不是10位以内的数串 :-)

祝你好运!

for i = 0 to 9
print i
next i

for i = 0 to 9
for j = 0 to 9
print i & j
next j
nexti

for i = 0 to 9
for j = 0 to 9
for k = 0 to 9
print i & j & k
next k
next j
next i

for i=0 to 9
print i
next
for i=0 to 9
print "0" & i
next
for i=10 to 99
print i
next
for i=0 to 9
print "00" & i
next
for i=10 to 99
print "0" & i
next
for i