VFP程序设计题 从键盘上输入10个数,用“冒泡排序法”按值从小到大顺序进行排序

2025-01-04 08:37:50
推荐回答(3个)
回答1:

DIMENSION ARRAYA(10)
FOR I=1 TO 10
INPUT "输入一个数:" TO ARRAYA(I)
ENDFOR
ASORT(ARRAYA,1,10,0)
FOR I=1 TO 10
??ARRAYA(I),","
ENDFOR

回答2:

嗯,我没有学过,好像很难啊

回答3:

CLEAR
DIMENSION ARRAYA(10)
FOR I=1 TO 10
INPUT "输入第"+ALLTRIM(STR(I))+"个数:" TO ARRAYA(I)
ENDFOR
ASORT(ARRAYA,1,10,0)
FOR I=1 TO 10
??ARRAYA(I),","
ENDFOR