VB程序设计题库集.doc

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
VB程序设计题库集

3 程序功能:求s=1+3+5+7+...直到s2000为止。程序中有两行有错误。改正错误,使它能输出正确的结果。 Private Sub Command1_Click() Dim i As Integer, s As Long s = 0 i = 1 Do Until s 2000 s = s + i i = i + 1 Loop Print s End Sub 2025 3 程序功能:求s=1+3+5+7+...直到s3000为止。程序中有两行有错误。改正错误,使它能输出正确的结果。 Private Sub Command1_Click() Dim i As Integer, s As Long s = 0 i = 1 Do Until s 3000 s = s + i i = i + 1 Loop Print s End Sub 3025 3 程序功能:计算s=2!+4!+8!。程序中有两行有错误。改正错误,使它能输出正确的结果。 Private Sub Command1_Click() Dim k As Integer, i As Integer Dim s As Long, t As Long s = 0 i = 1 Do While i = 3 t = 1 k = 1 While k = 2 * i t = t * k k = k + 1 Wend s = s + t i = i + 1 Wend Print s End Sub 40346 3 程序功能:计算s=2!+4!+6!+8!。程序中有两行有错误。改正错误,使它能输出正确的结果。 Private Sub Command1_Click() Dim k As Integer, i As Integer Dim s As Long, t As Long s = 0 i = 1 Do While i = 3 t = 1 k = 1 While k = 2 ^i t = t * k k = k + 1 Wend s = s + t i = i + 1 Wend Print s End Sub 41066 3 程序功能:求200到400间,能被3整除但不能被7整除的数的个数。程序中有两行有错误。改正错误,使它能输出正确的结果。 Private Sub Command1_Click() Dim count As Integer Dim x As Integer count = 0 x = 200 While x = 400 If x Mod 3 = 0 Or x Mod 7 0 Then count = count + 1 End If x = x + 1 Loop Print count End Sub 57 3 程序功能:求200到500间,能被13整除但不能被17整除的数的个数。程序中有两行有错误。改正错误,使它能输出正确的结果。 Private Sub Command1_Click() Dim count As Integer Dim x As Integer count = 0 x = 200 While x = 500 If x Mod 13 = 0 Or x Mod 17 0 Then count = count + 1 End If x = x + 1 Loop Print count End Sub 21 3 程序功能:求1到400间,同时能被3和7整除的数的个数。程序中有两行有错误。改正错误,使它能输出正确的结果。 Private Sub Form_Click() Dim count As Integer Dim x As Integer For x = 1 To 400 if mod(x,3)=0 and mod(x,7)=0 then count = count + 1 end if Next count print count End Sub 19 3 程序功能:求1到500间,同时能被5和9整除的数的个数。程序中有两行有错误。改正错误,使它能输出正确的结果。 Private Sub Command1_Click() Dim count As Integer Dim x As Integer For x = 1 To 500 if mod(x,5)=0 and mod(x,9)=0 then count

文档评论(0)

book1986 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档