下列变量名中,不符合标识符命名规则的是()
A: sum
B: _sum
C: 2sum
D: sum2
A: sum
B: _sum
C: 2sum
D: sum2
举一反三
- 变量名Sum和变量名sum表示同一个变量
- 在变量定义intsum,SUM;中sum和SUM是两个相同的变量名。()
- 下列字符串不符合标识符规定的是 A: SUM B: sum C: 3cd D: end
- 下面标识符命名不合法的是:( ) A: sum B: _sum C: ABC50% D: F_345_
- 在下列程序段中,不能计算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