vb题 s=0:n=5 for i=1 to n s=s+i next i print s;i 结果怎么是15
1个回答
s=0:n=5
for i=1 to n
s=s+i
next i
print s;i
当退出循环时,i的值一定是6
s=1+2+3+4+5=15
相关问题
for i=0 to 10 stup 3 s=s+1 next i print s 的结果是什么,..
s=0 For i=1 to 10 step 2 s=s+i Next Print s
for next 循环s=0for i=1 to 10 step 2s=s+1i=I*2next i当循环变量后,i,s
Dim a(4) s=0 For i=1 to 4 s=s+a(i) Next i
i=1,S=0,WHILE i≤50,S=S+i,i=i+1,WEND PRINT S END.程序执行后输出的结果S=
有如下Visual Basic程序段:s = 0 For i = 1 To 5 s = s + i Next i 该程序
s=0 i=1WHILE i≤4 s=i*s+i WEND PRINT s= ;sEND
已知程序段:s=0 For i =1 to 10 step 2 s = s+1 i = i * 2 Next i 当循环
For i = 2.6 To 4.9 Step 0.6 s = s + 1 Next i
语句S=0 i=1 Do S=S+i Loop while S≤200 n=i-2 Output n