vb程序设计教程第三版实验E.doc

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

Private Sub Form_click() Dim a(9) As Integer s = 0 Max = 30 Min = 100 For i = 0 To 9 Randomize a(i) = Int(Rnd * 71 + 30) If a(i) Max Then Max = a(i) If a(i) Min Then Min = a(i) s = s + a(i) Print a(i); Next i Print Print Max=; Max, Min=; Min, Avg=; s / 10 Print End Sub Private Sub Form_click() Dim a() a = Array(56, 78, 98, 88, 76, 78) For i = LBound(a) To UBound(a) Print String(Int(a(i) / 5), ◆); a(i) Print Next i End Sub Option Base 1 Dim a(20) As Integer Private Sub Command1_Click() For i = 1 To 20 Randomize a(i) = Int(Rnd * 101) Picture1.Print a(i); Print If i Mod 4 = 0 Then Picture1.Print Next i End Sub Private Sub Command2_Click() For i = 1 To 20 Select Case a(i) Case 0 To 59 n = n + 1 Case 60 To 69 b = b + 1 Case 70 To 79 c = c + 1 Case 80 To 89 d = d + 1 End Select Next i Picture2.Print 分数在0︿59的人数有; n Picture2.Print 分数在60︿69的人数有; b Picture2.Print 分数在70 ︿ 79的人数有; c Picture2.Print 分数在80 ︿89的人数有; d Picture2.Print 分数在90 ︿100的人数有; 20 - n - d - b - c End Sub Private Sub Form_click() Dim a(9) As Integer Print Tab(2); 排序前, For i = 0 To 9 a(i) = Int(Rnd * 90 + 10) Print a(i); Next i For n = 0 To 8 nmax = n For m = n + 1 To 9 If a(m) a(nmax) Then nmax = m Next m t = a(nmax): a(nmax) = a(n): a(n) = t Next n Print Print Tab(2); 排序前, For i = 0 To 9 Print a(i); Next i End Sub Private Sub Form_click() Dim a(9) As Integer Print Tab(2); 排序前, For i = 0 To 9 a(i) = Int(Rnd * 90 + 10) Print a(i); Next i For n = 8 To 0 Step -1 For m = 0 To n If a(m) a(m + 1) Then t = a(m + 1): a(m + 1) = a(m): a(m) = t Next m Next n Print Print Tab(2); 排序前, For i = 0 To 9 Print a(i); Next i End Sub Dim A(3, 3), B(3, 3) As Integer Private Sub Command1_Click() For i = 0 To 3 For j = 0 To 3 Randomize A(i, j) = Int(Rnd * 90 + 10) If i = j Then Picture1.Print Tab(j * 5); A(i, j); Next j Next i End Sub Private Sub Command2_Click() For i = 0 To 3 For j = 0 To 3 Randomize B(i, j) = Int(Rnd * 900 + 100) If j = i Then Picture2.Print Tab(6 * j); B(i, j); Next j Next i End Sub Private Sub Command3_C

文档评论(0)

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

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

1亿VIP精品文档

相关文档