freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

全國計(jì)算機(jī)二級筆記-資料下載頁

2025-07-06 17:11本頁面
  

【正文】 r St = L = Len(St) For I = 1 To L CH = Mid(St, I, 1) If CH = A And CH = Z Then Idx = Asc(CH) Asc(A) A(Idx) = A(Idx) + 1 ElseIf CH = a And CH = z Then Idx = Asc(CH) Asc(a) A(Idx) = A(Idx) + 1 End If Print A(Idx) Next I For I = 0 To 25 If A(I) 0 Then js = js + 1 Text2 = Text2 amp。 Chr(I + Asc(A)) amp。 : amp。 Str(A(I)) amp。 If js Mod 5 = 0 Then Text2 = Text2 amp。 Chr(13) amp。 Chr(10) End If Next I End Sub 第九講 數(shù)組 動態(tài)數(shù)組與控件數(shù)組重點(diǎn): 掌握動態(tài)數(shù)組的定義與使用 熟悉控件數(shù)組的建立及使用數(shù)組常用算法程序設(shè)計(jì)1 動態(tài)數(shù)組的概念:程序在運(yùn)行過程中,其元素個數(shù)(大小)可以改變的數(shù)組2 動態(tài)數(shù)組說明的一般格式:(說明數(shù)組時不指明維數(shù)及下標(biāo)范圍)dim 數(shù)組名() [as 數(shù)據(jù)類型]當(dāng)可以確定數(shù)組元素大小時對動態(tài)數(shù)組再次說明,用如下重定義數(shù)組語句: ReDim [Preserve] 數(shù)組名(維界定義) [As 數(shù)據(jù)類型 ] 說明:當(dāng)重新定義數(shù)組后,要保留原來數(shù)組中的數(shù)據(jù),則選擇preserve選項(xiàng)。 例如: Dim Pin() As Integer private Sub form_click() ReDim Pin(5) …… End Sub 詳細(xì)說明動態(tài)數(shù)組定義格式中的每個參數(shù)的作用,并進(jìn)行演示! 15時間接著用下面的例子來說明動態(tài)數(shù)組的作用!以下的例子可根據(jù)需要在講授時選擇!例1:有一組數(shù),以999結(jié)束,編程找出其中正數(shù)、負(fù)數(shù)、零的個數(shù)。(999不作為數(shù)據(jù)處理)注:例1和例3兩個中選擇一個講! Private Sub Form_click() Dim x() As Integer, n As Integer Dim n1 As Integer, n2 As Integer, n3 As Integer n = 1 Do ReDim Preserve x(n) x(i) = InputBox(請輸入一個數(shù)) Print x(i)。 If x(i) = 999 Then Exit Do If x(i) 0 Then n1 = n1 + 1 ElseIf x(i) = 0 Then n2 = n2 + 1 Else n3 = n3 + 1 End If n = n + 1 Loop Print Print 小于0的數(shù)據(jù)個數(shù)為:。 n1 Print 等于0的數(shù)據(jù)個數(shù)為:。 n2 Print 大于0的數(shù)據(jù)個數(shù)為:。 n3End Sub例2:打印下面的圖形: 選講內(nèi)容****************************** ***** ******* ** *********** ***** * ******** *******Private Sub Form_click() Dim i As Integer, j As Integer For i = 1 To 9 Print Tab(5)。 For j = 1 To 10 i Print *。 Next j Print Next iEnd SubPrivate Sub Form_click() Dim i As Integer, j As Integer For i = 1 To 5 Print Tab(5)。 For j = 1 To i Print *。 Next j Print Next iEnd SubPrivate Sub Form_click() Dim i As Integer, j As Integer For i = 1 To 4 Print Tab(9 i)。 For j = 1 To 2 * i 1 Print *。 Next j Print Next iEnd Sub例3 從鍵盤輸入任意個數(shù),求出這些數(shù)的總和和平均值!Dim a() as integerDim I as integer, sum as integer, avg as single, t as integerDo I=inputbox(“請輸入一數(shù)!”) If i=1 then Exit doElse T=t+1 Redim preserve a(t)A(t)=iSum=sum+iendifLoop Avg=sum/ubound(a)Print “sum=”。sum,”avg=”+cstr(avg)例4 編程實(shí)現(xiàn)隨機(jī)生成20個互不相同的兩位整數(shù)! Dim a() as integer ,I as integer, n as integer,j as integerRedim a(20) as integerFor i=1 to 20k= inputbox(“請輸入N的值”) for j=1 to i1 if a(j)=k then exit for next j if ji1 then a(i)=k else i=i1 endif next i例 5 在一組有序數(shù)列中插入一個數(shù),要求插入后的數(shù)還是有序數(shù)列! Dim a() as integer Dim I as integer , n as integer, k as integer For i=1 to 10A(i)=10*i Next i N=inputboxa(“請輸入要插入的數(shù)”) 以下有兩種方案1 前插入 2 后插入(可以用班級中的同學(xué)進(jìn)行示范教學(xué)) T=10Redim preserve a(11) Do while na(t) A(t+1)=a(t) T=t1Loop A(t+1)=nFor i=1 to 11 Print a(i)。Next i 后插入法給學(xué)生講清算法的原理,要求學(xué)生自己課后寫出程代碼!9.2 控件數(shù)組一、控件數(shù)組:   動態(tài)數(shù)組指在聲明數(shù)組時未給出數(shù)組的大?。ㄊ÷岳ㄌ栔械南聵?biāo)),當(dāng)要使用該數(shù)組時,隨時可用ReDim語句重新定義數(shù)組的大小。使用動態(tài)數(shù)組的優(yōu)點(diǎn)是:用戶可以根據(jù)需要有效地利用存儲空間,它是在程序執(zhí)行到ReDim語句時分配存儲空間。二、建立控件數(shù)組方法:1復(fù)制現(xiàn)存控件: 在窗體上繪制控件數(shù)組中第一個元素的控件→設(shè)置它的名稱屬性→右鍵單擊此對象→復(fù)制→右擊窗體→粘貼。(重復(fù)復(fù)制操作)將已存在的控件組成一個數(shù)組。(同一類型的控件)確定第一個元素→選定要包含在控件數(shù)組中的其它對象→將它的名稱屬性設(shè)置成和第一個元素相同。(重復(fù)此操作) 說明:1 控件數(shù)組中的每個元素下標(biāo)為此控件的index 屬性值(≤32767)控件數(shù)組中的每個控件共享一個事件過程。2創(chuàng)建同名控件 在控件面板中直接添加相同類型的控件到窗體上,將它們的名子都命名為同一個名子時,系統(tǒng)將會提示你創(chuàng)建一個控件數(shù)組三、應(yīng)用舉例使用控件數(shù)組實(shí)現(xiàn)字體格式的設(shè)置! 數(shù)組應(yīng)用例題(根據(jù)時間可以選擇一個講!)根據(jù)需要,選擇1-2道下面的題目,給學(xué)生講清楚算法的思想!1 排序例53 選擇排序法 直接排序法Option Explicit Option Base 1 Private Sub CmdSort_Click() Dim Sort(10) As Integer, Temp As Integer Dim I As Integer, J As Integer Randomize For I = 1 To 10 Sort(I) = Int(Rnd * (100 1)) + 1 Text1 = Text1 amp。 Str(Sort(I)) Next I For I = 1 To 9 For J = I + 1 To 10 If Sort(I) Sort(J) Then Temp = Sort(I) Sort(I) = Sort(J) Sort(J) = Temp End If Next J Text2 = Text2 amp。 Str(Sort(I)) Next I Text2 = Text2 amp。 Str(Sort(10))End SubOption Explicit Option Base 1 Private Sub CmdSort_Click() Dim Sort(10) As Integer, Temp As Integer Dim I As Integer, J As Integer Dim Pointer As Integer Randomize For I = 1 To 10 Sort(I) = Int(Rnd * (100 1)) + 1 Text1 = Text1 amp。 Str(Sort(I)) Next I For I = 1 To 9 Pointer = I For J = I + 1 To 10 If Sort(Pointer) Sort(J) Then Pointer = J End If Next J If I Pointer Then Temp = Sort(I) Sort(I) = Sort(Pointer) Sort(Pointer) = Temp End If Text2 = Text2 amp。 Str(Sort(I)) Next I Text2 = Text2 amp。 Str(Sort(10))End Sub2 查找例:54 順序查找程序 (界面見P105) 先介紹For Each –next 結(jié)構(gòu)的語句:Option Explicit Option Base 1 Dim Search As Variant Private Sub Cmd生成數(shù)組_Click() Dim I As Integer, Element As Variant Search = Array(34, 12, 56, 81, 59, 83, 91, 26, 47) For Each Element In Search ‘for eachnext 結(jié)構(gòu)語句見P90 Text1 = Text1 amp。 Str(Element) Next Element End Sub
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1