求1-2009年之间闰年数
为统计1-2004自然数之中3的倍数的个数,有人设计了左边的算法流程图,请你仔细阅读后把它填写完整.
一份单据中被涂抹的数字的推算。一张单据上有一个5位数的编号,其百位数和十位数处已经变得模糊不清,但是知道这5位数是37或67的倍数。现在要设计一个
算法,找出所有满足这些条件的5位数,并统计这些5位数的个数。
冒泡排序
冒泡排序核心程序
数组d存放待排序数据,d(1)~d(n),按非减次数排列
For i=1 to n-1
For j=n to i+1 step -1 If d(j) End If Next j Next i 冒泡排序代码设计 Dim d(1 To 128) As Integer Dim ct As Integer '定义全局变量 Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then ct = ct + 1 d(ct) = Val(Text1.Text) List1.AddItem Str(d(ct)) Text1.Text = \"\": Text1.SetFocus '准备在text1接受下一个数据 End If End Sub 选择排序 选择排序核心程序 数组d存放待排序数据,d(1)~d(n),按非减次数排列 For i = 1 To n - 1 k = i For j = i + 1 To n If d(j) < d(k) Then k = j Next j If i <> k Then temp = d(i): d(i) = d(k): d(k) = temp End If Next i 选择排序代码设计 Dim a(1 To 6) As Integer Dim n As Integer, i As Integer Dim j As Integer, k As Integer '定义全局变量 Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then n = n + 1 a(n) = Val(Text1.Text) List1.AddItem Str(a(n)) Text1.Text = \"\" Text1.SetFocus End If End Sub Private Sub Command1_Click() For i = 1 To n - 1 k = i For j = i + 1 To n If ①此处自己填写 Then k = j Next j If i <> k Then t = a(i) a(i) = a(k) ②此处自己填写 End If Next i For i = 1 To n List2.AddItem Str(a(i)) Next i End Sub 顺序查找 对分查找 因篇幅问题不能全部显示,请点此查看更多更全内容