Dim m%,n% For m=1 To 3 For n=1 To 5 Step 2 n=n+1 Next n Next m.问n=n+1执行多少次

来源:学生作业帮助网 编辑:作业帮 时间:2024/12/04 17:10:08
Dim m%,n% For m=1 To 3 For n=1 To 5 Step 2 n=n+1 Next n Next m.问n=n+1执行多少次
xTMO@+D)/.GcwCVZDh<NA%""_-x/eGwޛμVy kE2Jk(: 12s:et;3>/ӴS}ݤ7NEiUВPV7COi!nZ_``d06:_N{@eKV_%A10x0"\3t q#a^*=l;UuD?¾kD/@ΦE͋<5oPn>a*URfR8CQ?>Y`E93I5 <K +{Nol/2VIuX'NK~`d/t5LLw{ n\_ Ho*gH7C!

Dim m%,n% For m=1 To 3 For n=1 To 5 Step 2 n=n+1 Next n Next m.问n=n+1执行多少次
Dim m%,n% For m=1 To 3 For n=1 To 5 Step 2 n=n+1 Next n Next m.问n=n+1执行多少次

Dim m%,n% For m=1 To 3 For n=1 To 5 Step 2 n=n+1 Next n Next m.问n=n+1执行多少次

循环嵌套:

  第一层循环 m = 1 to 3  可执行3次

      第二层循环 n = 1 to 5 step 2 ,分别执行n = 1, n =2+2 <5 两次 

所以,n = n + 1 总共执行 3 * 2 = 6 次 !

测试代码如下:

Sub Command1_Click()
    Dim m%, n%, s%
    For m = 1 To 3
        For n = 1 To 5 Step 2
            n = n + 1
            s = s + 1
            Print "第" & s & "次:"; n
    Next n, m
End Sub

Private Sub Form_Click()Dim m%,n%m = 1For n = 1 To 10 Step 2m = m + n n = n + 1 Next nPrint n=; n,m=; mEnd Sub Dim m%,n% For m=1 To 3 For n=1 To 5 Step 2 n=n+1 Next n Next m.问n=n+1执行多少次 Private Sub Command0_Click() Dim a(10, 10) For m = 2 To 4 For n = 4 To 5 a(m, n) = m * n Next n Nex答案是42.谁能帮我解析一下啊?谢谢!Private Sub Command0_Click() Dim a(10, 10) For m = 2 To 4 For n = 4 To 5 a(m, n) = m * n Next n vb求m+mm+mmm+...+mm...mmm(n个m)要求 n ,m值 用 inputbox输入Dim m%,n%,i%,j%,a(0 To 9999999) As IntegerPrivate Sub Form_Click()m = InputBox(请输入m值 )n = InputBox(请输入n值 )For i = n To 0 Step -1a(n) = a(n) + 10 ^ (i - 1)Next iPrin Dim j%,i%,m% m = 0 For i = 1 To 3 For j = 1 To i m = m + j Next j,i Text1 = Str(m)最后m j 是多少 怎么理解vb中 dim m(10) for i=1 to 5 m(i)=i*i next i print m(i-1) vb计算1!+3!+*****+(2n+1)!的代码Private Sub Command1_Click()Dim n As Integer, i As Integer, j As Integern = Val(InputBox(请输入N值))m = 1: Sum = 0For i = 1 To 2 * n + 1 Step (2)For j = 1 To im = m * jNext jSum = Sum + mNext iPrint SumEn 请给下面程序中的 If I = 0 Then这一句解释一下,Const n = 10Dim data()Private Sub Form_Load()Me.AutoRedraw = TrueReDim data(n)For I = 1 To ndata(I) = 10 * IPrint data(I);NextEnd SubPrivate Sub Command1_Click()Dim I%,J%,x%Static m%Print:Pr VB.NET2010 给定求组合数公式为Cmn=m!/n!(m-n)!,编一程序,输入m和n的值,求Cmn的值.要用Sub过程Imports System.ConsoleModule Module1Private Sub fac(ByVal x As ULong,ByVal y As ULong)Dim i&,a&a = 1For i = 1 To xa = a * iNext iy = aEnd Private Sub Command1_Click()Dim count(25) As Integer,ch As Stringch = UCase(InputBox(qing shu))For k = 1 To Len(ch)n = Asc(Mid(ch,k,1)) - Asc(A)If n >= 0 Thencount(n) = count(n) + 1End IfNext km = count(0)For k = 1 To 25If m < count(k) Thenm = co Private Sub command1_click() Dim m(10) For k = 1 To 10 m(k) = 11 - k Next k x = 5 Print m(2 + m(x))VB的一个程序 Dim x(100), a For i = 1 To 100 x(i) = i Next i For Each a In x() s = ss = s + aNextLabel1.Caption = sStatic n As Integer, m As Integerm = 100: n = 0: s = 0For Each x In a If x > n Then n = x If x < m Then m = x s = s + xNextMsgBox 最大值为 Dim arr(0 To 30,0 To 11) As Double for i = 1to31 arr(m-1,0)=arr(m-1,0)+1 next i 表达有啥毛病?刚才问题可能没说清楚我想建立一个数组,然后在一定条件判断下让数组里的数从0开始加,每满足一个条件就加1.Dim a Dim n%(1 To 3)是什么意思?Dim n%(1 To 3) 是什么意思呀 %又是什么? n=0 for m=1 to rs.PageSize if rs.EoF then exit for n=6 m =8 x=max(n,m) for i=x to m*n if mod (i,m)=0 and mod (i,n)=0 y1=1 str(m*n/y vb求n阶乘表达式Private Sub Command1_Click()Dim n As Integern = InputBox(请输入一个正整数: )Print Fac(n)End SubPrivate Function Fac(m) As Long '' '请不要删除该行,只在下一行中填空' For k = 2 to Fac = Fac for m=0 to 7step 3 for n=1 to 3 next n next m 求内循环总次数 具体过程