2016-上机作业3-VFP程序设计题.docVIP

  • 8
  • 0
  • 约2.04千字
  • 约 5页
  • 2018-11-29 发布于浙江
  • 举报
2016-上机作业3-VFP程序设计题

第三次上机实习作业 1、有一函数: x (x1) y= 2x-1 (1≤x<10) 3x-11 (x≥10) 编写程序,输入x,输出y的值。 set?talk?off clear store?0?to?y input请输入一个数x=to?x if?x1 y=x endif if?1=x?and?x10 y=2*x-1 endif if?x=10 y=3*x-11 endif ?y=,y 2.利用数组编写程序,从键盘输入10个数,再按逆序输出。 set?talk?off clear dime?a(10) inputa=to?a(1) inputb=to?a(2) inputc=to?a(3) inputd=to?a(4) inpute=to?a(5) inputf=to?a(6) inputg=to?a(7) inputh=to?a(8) inputi=to?a(9) inputj=to?a(10) for?i=10?to?1?step-1 ?a(i) endfor 写程序,输入一个三位自然数,判断该数是否为水仙花数。所谓水仙花数是指一个三位自然数,其各位数字立方和等于该数本身。例如,153是水仙花数,因

文档评论(0)

1亿VIP精品文档

相关文档