• 2022-07-28
    在下列程序段中,不能计算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