Dim n% n = 1 Do Until n > 6 Print n; n = n + 2.4 Loop运行结果为1,3,5为什么不是1,3,6

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/22 21:21:45
Dimn%n=1DoUntiln>6Printn;n=n+2.4Loop运行结果为1,3,5为什么不是1,3,6Dimn%n=1DoUntiln>6Printn;n=n+2.4Loop运行结果为1,3

Dim n% n = 1 Do Until n > 6 Print n; n = n + 2.4 Loop运行结果为1,3,5为什么不是1,3,6
Dim n% n = 1 Do Until n > 6 Print n; n = n + 2.4 Loop
运行结果为1,3,5
为什么不是1,3,6

Dim n% n = 1 Do Until n > 6 Print n; n = n + 2.4 Loop运行结果为1,3,5为什么不是1,3,6
3+2.4=5.4,对应整数是5,不是6.

Dim n% n = 1 Do Until n > 6 Print n; n = n + 2.4 Loop运行结果为1,3,5为什么不是1,3,6 Dim s As Long,n As SinglePrivate Sub Command1_Click()n = 0Do While s < 20n = n + 1s = 12 * (1 + 0.01) ^ nLoopPrint n; 年后我国人口将增长到20亿EndEnd Sub Dim n%(1 To 3)是什么意思?Dim n%(1 To 3) 是什么意思呀 %又是什么? VB编程求前N项和过程y=1+ x^2/(2!)+x^4/(4!)+.x^(2n)/((2n)!)补充代码 y=1+ x^2/(2!)+x^4/(4!)+.x^(2n)/((2n)!)public sub progession(sum#,,eps#)dim n%,t#n=2sum=1t=1do while (abs(t)>=eps)t=sum=sum+tn=loopend subprivate sub form_click()dim p1#call Private Function fact(n As Integer) As Integer fact = 1 Do While n > 0 fact = fact * n n = n - 1 LoopEnd FunctionPrivate Sub Form_Click() Dim sum As Integer,i As Integer For i = 4 To 1 Step -1 sum = sum + fact(i) Next Print Sum=; sumEnd Subsum=24, xiexie在窗体上画两个文本框和一个命令按扭,然后程序如下:Private Sub Command1_Click()Dim x As Integer,n As Integerx = 1n = 0Do While x < 20x = x * 3n = n + 1LoopText1.Text = Str(x)Text2.Text = Str(n)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执行多少次 利用π/4≈1-1/3+1/5-1/7+… 求π得近似值 最后一项小于0.000001.我的代码是下面这样,算出来π=2.6667?Private Sub Command1_Click()Dim p As Double, n As Long, t As Integer, s As Double p = 1: n = 1: t = 1 Do n = n + 1 s = 1 / 删除一个数列中的重复数Option ExplicitOption Base 1Dim A() As Integer '定义了一个模块级的动态数组Private Sub Command1_Click() Dim N As Integer, I As Integer Text1 = Text2 = N = Inpu n=6 Do Print n n=n+1 Loop while n n=6 Do Print n n=n+1 Loop while n 已知:Option Base 0,Dim A(),n% = 7,则下列操作中,错误的操作是( ).已知:Option Base 0,Dim A(),n% = 7,则下列操作中,错误的操作是( ).(1分)A、ReDim A(n)B、ReDim A(n-7)C、ReDim A(n+2)D、ReDim Preserve A(1 To n) 已知:Option Base 0,Dim A(),n% = 7,则下列操作中,错误的操作是( )已知:Option Base 0,Dim A(),n% = 7,则下列操作中,错误的操作是( ).(1分)A、ReDim A(n)B、ReDim A(n-7)C、ReDim A(n+2)D、ReDim Preserve A(1 To n) vb求和,求sin(x)=x/1-x^3/3!+x^5/5!- …… (-1)^(n-1)* x^(2*n-1)/(2n-1)!感叹号是阶乘的意思Private Sub Form_Click()Dim x%,,i%,q%x = Val(InputBox(请输入X的值))Do While t >= 10 ^ (-5)s = s + tn = n + 1For k = 1 To 2 * n - 1q = q * kNex 用Do...Loop循环语句,求m和n的最大公约数,以下是程序代码,Private Sub Command1_Click()Dim m As Long,n As Long,t As Longm = Val(Text1.Text)n = Val(Text2.Text)If m < n Thent = m:m = n:n = tEnd IfDor = m Mod nm = nn = rLoop While r 0Labe 数学中有很多公式,例如x=1*n+2*(n-1)+……+(n-1)*2+n*1,试设计程序当用户输入n的值时求出x的值.Private Sub Command1_Click()Dim n,i As **** '定义n和i为整形数Dim x As Long '定义x为长整形数n = Val(Text***.Tex vb题 下面程序的功能是什么?Private Sub Command1_Click() Dim s%,n% Dim a As String n = 0 a = InputBox(Please input a number:) For s = 1 To Len(a) If (func(Val(Mid(a,s,1)))) Thenn = n + 1NextPrint n End Sub Private Function func(x%) As Bool