急~!Visual Foxpro 程序设计基础题目

2025-04-19 08:34:02
推荐回答(3个)
回答1:

1.
zl=0
money=0
input "输入邮件重量:" to zl
if zl<=100 then
money=zl*0.05
endi
if zl>100 then
money=zl*0.02
endi
? "金额为:",money

2.
t=0
c=1
for a=1 to 10
for b=1 to a
c=c*b
next
t=t+c
next
? "1!+2!+……+10!=",t

回答2:

1.
w=0
m=0
wait"输入邮件重量:" to w
if w<=100
m=w*0.05
endif
if w>100
m=100*0.05+(w-100)*0.02
endif
? "金额为:",m

2.
t=1
m=0
for i=1 to 10
m=m+t*i
endfor
? "1!+2!+……+10!=",m

回答3:

1.第一题计算需要用到的数据没有里程和时间。
input "请输入物品重量:" to a
if a<=100 and a>0
s=0.05a
else
s=0.02a+3
endif
?"邮费为:",s
2.i=1
s=1
T=0
do while i<=10
s=s*i
T=T+s
i=i+1
enddo
?T