下面的程序代码,运行结果为:( )。i=1sum=0While i<;=100sum=sum+ii=i+1print(sum)
A: 0
B: 5050
C: 100
D: 1
A: 0
B: 5050
C: 100
D: 1
举一反三
- 下面的程序代码,运行结果为:( )。[br][/br] [br][/br]i=1[br][/br] sum=0[br][/br] while i[=100:<br] sum=sum+i [br][/br] i=i+1 [br][/br] print(sum) A: 0 B: 5050 C: 100 D: 1
- 下面的程序代码,运行结果为() i = 1 sum = 0 while i<; = 8: sum=sum+i i = i + l print(sum) A: 36 B: 28 C: 26 D: 35
- 程序: clear sum=0; for i=1:100 sum=sum+i; end sum 运行后结果sum=( ) A: 5010 B: 5030 C: 5050 D: 5070
- 看程序,写结果 main() { int i,sum=0; i = 1; while (i < 100) { sum = sum + i; i++; } printf("%d",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