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

正文內(nèi)容

vb程序改錯(cuò)40題含答案-資料下載頁(yè)

2025-06-09 21:26本頁(yè)面
  

【正文】 39。題目:下面的程序用來產(chǎn)生并輸出圖示的楊輝三角。39。 139。 1 139。 1 2 139。 1 3 3 139。 1 4 6 4 139。 1 5 10 10 5 139。Option ExplicitPublic Sub readin(a() As Integer, n As Integer) Dim i, j As Integer For i = 1 To n a(i, n) = 1 a(i, 1) = 1 Next i For i = 3 To n For j = 2 To n a(i, j) = a(i 1, j) + a(i 1, j 1) Next j Next iEnd SubPublic Sub printf(a() As Integer, n As Integer) Dim i, j As Integer For i = 1 To n For j = 1 To n Print Tab(5 * j + 10)。 a(i, j)。 Next j Print Next i PrintEnd SubPrivate Sub Form_Click() Dim x(10, 10) As Integer Call readin(x(), 6) Call printf(x(), 6)End Sub答案:=======(答案1)=======a(i, i) = 1=======(答案2)=======For j = 2 To i 1=========或=========For j = 2 To 1 + i=======(答案3)=======For j = 1 To i第60題 () 題號(hào):14639。39?!境绦蚋腻e(cuò)】39。39。題目:用輾轉(zhuǎn)相除法求兩個(gè)整數(shù)的最大公約數(shù)。39。Option ExplicitFunction gcd(ByVal m As Integer, ByVal n As Integer) As Integer Dim r As Integer r = m Mod n Do While r 0 n = m n = r r = m Mod n Loop gcd = rEnd FunctionPrivate Sub Form_Click() Dim a As Integer, b As Integer, c As Integer a = InputBox(輸入一個(gè)整數(shù)) b = InputBox(輸入一個(gè)整數(shù)) a = Val(a) b = Val(b) Call gcd(a, b) Print a, b, cEnd Sub答案:=======(答案1)=======m = n=======(答案2)=======gcd = n=======(答案3)=======c = gcd(a, b)第65題 () 題號(hào):49239。39?!境绦蚋腻e(cuò)】39。39。題目:輸入兩個(gè)正整數(shù)m和n,求其最大公約數(shù)。39。Option ExplicitPrivate Sub Form_Click() Dim m As Integer, n As Integer, r As Integer m = InputBox(輸入m的值:) n = InputBox(輸入n的值:) Do While n 0 r = m / n m = n n = m Loop Print 兩數(shù)的最大公因子為:。 nEnd Sub答案:=======(答案1)=======r = m Mod n=======(答案2)=======n = r=======(答案3)=======Print 兩數(shù)的最大公因子為:。 m第66題 () 題號(hào):46739。39。【程序改錯(cuò)】39。39。題目:從計(jì)算機(jī)輸入三個(gè)數(shù) , 找出中間數(shù)39。Option ExplicitPrivate Sub FindMidNum() Dim x As Integer, y As Integer, z As Integer, A As Integer x = InputBox(PLEASE INPUT THE FIRST NUMBER) y = InputBox(PLEASE INPUT THE SECOND NUMBER) z = InputBox(PLESSE INPUT THE THIRD NUMBER) If x y Then A = x x = y y = A End If If y = z Then Print y ElseIf x = z Then Print z Else Print x End IfEnd SubPrivate Sub Form_Click() FindMidNumEnd Sub答案:=======(答案1)=======If x y Then=========或=========If y x Then=======(答案2)=======If y = z Then=========或=========If z = y Then=======(答案3)=======ElseIf x = z Then=========或=========ElseIf z = x Then第70題 () 題號(hào):14239。39?!境绦蚋腻e(cuò)】39。39。題目:程序功能根據(jù)輸入的學(xué)習(xí)成績(jī),分別顯示優(yōu)秀39。 (90分以上), 良好(75分以上),及格(60分以上)39。 不及格四個(gè)等級(jí).39。Option ExplicitPrivate Sub Form_Click()ClsDim i As Integeri = InputBox(請(qǐng)輸入學(xué)習(xí)成績(jī))Select Case i Case 0 i 100 MsgBox 成績(jī)應(yīng)該在0100之間 Case 90 Print 優(yōu)秀 Case 75 To 89 Print 良好 Case 60 To 74 Print 及格 Case MsgBox 不及格, vbCriticalEnd SelectEnd Sub答案:=======(答案1)=======Case is100 ,is0 =========或========= case is0 ,is100=======(答案2)=======Case 90 to 100=======(答案3)=======Case else第71題 () 題號(hào):47339。39?!境绦蚋腻e(cuò)】39。39。題目:下列程序進(jìn)行n階乘運(yùn)算,當(dāng)階乘的值超過21147483648 溢出報(bào)錯(cuò),并將結(jié)果輸出為1。39。Option ExplicitPrivate Function jc(ByVal n As Integer) As Integer Dim I As Integer Dim result As Long result = 1 I = 1 Do While I = n If result 2114748348 / I Then result = result I = I + 1 Else = 溢出 jc = I Exit Function End If Loop jc = resultEnd FunctionPrivate Sub Form_Click() MsgBox jc(3)End Sub答案:=======(答案1)=======Private Function jc(ByVal n As Integer) As Long=======(答案2)=======result = result * I=========或=========result = I * result=======(答案3)=======jc = 1第72題 () 題號(hào):14539。39。【程序改錯(cuò)】39。39。題目:該程序的功能是求出100到200之間的全部素?cái)?shù),39。 并且按每行4個(gè)、每個(gè)數(shù)據(jù)之間有10個(gè)空格的格39。 式輸出。39。Option ExplicitPrivate Sub Form_Click() Dim k As Integer, i As Integer, j As Integer k = 0 For i = 100 To 200 For j = 1 To i 1 If i Mod j = 0 Then Exit For Next j If j = i Then Print i。 Tab(10)。 k = k + 1 If k Mod 5 = 0 Then Print 。 End If Next iEnd Sub答案:=======(答案1)=======For j = 2 To i 1=========或=========For j = 2 To 1 + i=======(答案2)=======Print i。 Space(10)。=========或=========Print i。 Spc(10)。=======(答案3)=======If k Mod 4 = 0 Then Print=========或=========If 0 = k Mod 4 Then Print=========或=========if k/4 = k \4 then Print=========或=========if k\4 = k/4 then Print=========或=========if k/4 = int(k/4) then Print第73題 () 題號(hào):13239。39?!境绦蚋?
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)教案相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1