与VBA语句DimVar%,sum!等价的是()
A: Dim Var As Double, sum As Single
B: Dim Var As Integer, sum As Double
C: Dim Var As Single, sum As Double
D: Dim Var As Integer, sum As Single
A: Dim Var As Double, sum As Single
B: Dim Var As Integer, sum As Double
C: Dim Var As Single, sum As Double
D: Dim Var As Integer, sum As Single
举一反三
- 以下定义数组的语句中,正确的是______。 A: Dim a( ,) as Integer B: Dim a(5 To 1) As Integer C: Dim a(-3 To 2000) As Single D: Dim a(n) As Double
- 求sum=1+2+3+……;当sum的值刚刚超过1000时退出循环,输出此时sum的值(答案用小写字母)Dim sum As Double, I As Integer i= 1sum = 0Do While ________sum = sum +i______________LoopPrint sum
- 在下列程序段中,不能计算1到100之间奇数之和的是__________。 A: Dim sum As Integer sum = 0 For i = 1 To 100 Step 2 sum = sum + i Next B: Dim sum As Integer sum = 0 For i = 1 To 100 If i Mod 2 <> 0 Then sum = sum + i Next C: Dim sum As Integer sum = 0 For i = 1 To 99 sum = sum + i Next D: Dim sum As Integer sum = 0 For i = 100 To 1 Step -1 If i Mod 2 <> 0 Then sum = sum + i Next
- 在VB中,使用变量前一般应对变量进行定义。以下变量定义语句错误的是()。 A: Dim x As Integer B: Dim x As Integer,y As Single C: Var x,y:Integer D: Dim x As Integer,y As Integer
- 下列数组声明初始化语句,________是正确的。 A: Dim a( ) As Single={1,2,3,4,5,6,7,8,9,10} B: Dim a(9) As Single={1,2,3,4,5,6,7,8,9,10} C: Dim a() As Single={1,”a”,”bc”,4,5,6,7,8,9,10} D: Dim a( , ) As Integer={1,2,3,4,5,6,7,8,9,10} E: Dim a( ) As Integer=(1,2,3,4,5,6,7,8,9,10)