各位帮忙解决几题VFP菜鸟级别编程题....

来源:百度知道 编辑:UC知道 时间:2024/05/18 06:57:12
几道基础编程题...帮我写一下..如果在一点之前给促答复最好。因为要考试,没办法,自己又做不来...只能求助各位
帮帮忙了...问题解决了给MP...全部解决给500mp
谢谢了,下面是题目
1:从键盘输入数值是M,编程求从M开始能北3整除且个位数是3的N
(键盘输入1个这样的数)
2:编程求给定输入正实数数值中最大和最小的数
3:货运公司的运费价格为:本地每吨10元,外地每吨
20元,距离在500公里以上(含500公里)每吨25元,编程计算显示 运费

就是这三道了~对于高手来说,真的是小菜一叠...但我这种
一看头都大了...

第一道题:
set talk off
clear
input "请输入一个数" to m
do while .t.
if int(m/3)=m/3
a=m%10
if a=3
exit
endif
endif
m=m+1
enddo
?"这个数是"+str(m,10)
set talk on
return

第二道题:
set talk off
clear
input "请输入你想比较的数的个数: " to n
dimen a(n)
for x=1 to n
input "请输入第"+str(x,10)+"个数: " to a(x)
endfor
max=a(1)
min=a(1)
for x=2 to n
if a(x)>max
max=a(x)
endif
if a(x)<min
min=a(x)
endif
endfor
?"最大的数是: "+str(max,10)
?"最小的数是: "+str(min,10)
set talk on
close all
return

第三道题:
set talk off
clear
accept "请选择是本地还是外地!a:本地;b:外地 " to diqu
input "请输入公里数: " to x
if diqu="a"
if x>=500
s=25*x
else
s=10*x
endif
endif
if diqu="b