哪位高手帮我编一下这个程序呀 特别特别简单 谢谢了用vfp语言

来源:百度知道 编辑:UC知道 时间:2024/05/17 16:08:33
程序先要求使用者输入N个要排序的数,然后使用者一次输入N个数,最后在屏幕上输出从小到大排列后的数.

input "输入数据个数:" to n
dimension a(n)
for i=1 to n
input "请输入第"+str(i)+"个数据:" to a(i)
next i
?? "排序前的n个数是:"
for i=1 to n
?? a(i)," "
next i
?
for i=1 to n
for j=i+1 to n
if a(i)>a(j) then
t=a(i)
a(i)=a(j)
a(j)=t
endif
next j
next i
?? "排序后的n个数是:"
for i=1 to n
?? a(i)," "
next i
?

没问题的程序