vfp 如何将3 4 5 9这四个随机数字按顺序排列,急!在线等!
发布网友
发布时间:2024-10-23 18:24
我来回答
共1个回答
热心网友
时间:2024-11-01 06:42
DIMENSION x(4)
x(1) = 5
x(2) = 9
x(3) = 4
x(4) = 3
FOR i=1 TO 4
FOR j=i+1 TO 4
IF x(i)>x(j)
a = x(i)
x(i) = x(j)
x(j) = a
ENDIF
ENDFOR
ENDFOR
FOR i=1 TO 4
??x(i)
ENDFOR