- 41
- 0
- 约5千字
- 约 8页
- 2015-09-26 发布于重庆
- 举报
vfp程序设计题(附参考答案)
VFP程序设计题(附参考答案)
范茂华
1.求1到2000之间,能被3或7整除,并且含有数字5的整数的个数、它们的和、它们的平方根的和(保留2位小数)、以及它们的平方和。
clear
store 0 to n,s1,s2,s3
for i=1 to 2000
if (mod(i,3)=0 or i%7=0) and ‘5’$str(i)
n=n+1
s1=s1+i
s2=s2+sqrt(i)
s3=s3+i^2
endif
next
? “个数:”,n,”和:”,s1,”平方根和:”,s2,”平方和:”,s3
return
2.求能被3整除且至少有一位数字为5的三位数的个数。
clear
n=0
for i=100 to 999
if i%3=0 and 5$str(i)
n=n+1
endif
next
?n
return
3.求出只要能被2,7,9之一整除的800以内的正整数的个数。
clear
n=0
for i=1 to 800
if i%3=0 or i%7=0 or i%9=0
n=n+1
endif
next
?n
return
4.求[105,625]间能同时被7和11整除的自然数之和。求[200,600]间奇数之和。
clear
s=0
for i=105 to 625
if i%7=0 and
您可能关注的文档
- SSL证书被攻击被假冒的风险分析.doc
- SSL证书已被企业邮箱广泛采用 加强信息传输安全性.pdf
- SSL通信原理及Tomcat SSL双向配置.pdf
- SSL教学法对学生学习主动性的培养.pdf
- SSO的工作原理示意图.ppt
- stack与heap的区别.pdf
- Stability Analysis For a Class of Nonlinear Switched Systems.pdf
- Stability Analysis of the Ant System Dynamics with Nonuniform.pdf
- stanford parser的学习小结王宇.docx
- State Equations of Nonlinear Dynamic Systems.pdf
原创力文档

文档评论(0)