大家帮帮忙VFp???

来源:百度知道 编辑:UC知道 时间:2024/06/03 23:10:56
在页面输入三个数字 设计程序 让它们能从小到大排列输出
要求用 if esle end if
程序是VFp

SET TALK OFF
CLEAR
dimension a(3)
FOR x=1 TO 3
INPUT "请输入第"+ALLTRIM(STR(x))+"个数" TO a(X)
ENDfor
FOR m=1 TO 3
FOR n=m+1 TO 3
IF a(m)<a(n) then
ELSE
y=a(m)
a(m)=a(n)
a(n)=y
ENDIF
ENDFOR
ENDFOR
FOR x=1 TO 3
? a(x)
endfor
SET TALK ON
RETURN

set talk off
clear
input"a=" to a
input"b=" to b
input"c=" to c
if a>b
t=a
a=b
b=t
endif
if a>c
t=a
a=c
c=t
endif
if b>c
t=b
b=c
c=t
endif
?a,b,c
set talk on