在vfp中,编写一个程序,使输入四个数,从大到小排序
1个回答
展开全部
input "a=" to a
input "b=" to b
input "c=" to c
input "d=" to d
if a>b then
t=a
a=b
b=t
endif
if a>c then
t=a
a=c
c=t
endif
if a>d then
t=a
a=d
d=t
endif
if b>c then
t=b
b=c
c=t
endif
if b>d then
t=b
b=d
d=t
endif
if c>d then
t=c
c=d
d=t
endif
?a," ",b," ",c," ",d
input "b=" to b
input "c=" to c
input "d=" to d
if a>b then
t=a
a=b
b=t
endif
if a>c then
t=a
a=c
c=t
endif
if a>d then
t=a
a=d
d=t
endif
if b>c then
t=b
b=c
c=t
endif
if b>d then
t=b
b=d
d=t
endif
if c>d then
t=c
c=d
d=t
endif
?a," ",b," ",c," ",d
追问
then的作用
追答
then的作用
请查阅书上if ...then...语句的使用格式。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询