qbasic 变量不相等

来源:百度知道 编辑:UC知道 时间:2024/06/03 00:03:43
我让
for a=1 to 19
for b=1 to 19
for c=1 to 19
......
for s=1 to 19
什么语句能最简单的使这19个变量全都不相等?
如果相等可以next s,nest r...
输出这19个变量全不相同的情况!

for a =1 to 19
for b = a to 19
for c = b to 19
for d = c to 19
………………
for s= r to 19
next a,b,c,d,e,f…………
你的问题提的太古怪,晕,补充一下说明

for a = 1 to 19
for b = a+1 to 19
for c = b+1 to 19
for d = c+1 to 19
………………
next d
next c
next b
next a

或者是这样:
for a = 1 to 19
for b = 1 to 19
for c = 1 to 19
for d = 1 to 19
if a <> b and a <> c and a <> d and ...... then
………………
end if
next d
next c
next b
next a
不过这样太麻烦了,还是建议你用前一种方法。