dim I% ,S% s=0 for I=5 to 1 s=s+i next I print “s=” ; s 怎么看的
dim I% ,S%
s=0
for I=1 to 5 step -1
s=s+i
next I
print “s=”;s 还有这个一起求解释~
人气:355 ℃ 时间:2020-05-23 17:48:52
解答
For...Next 语句以指定次数来重复执行一组语句.语法For counter = start To end [Step step][statements][Exit For][statements]Next [counter]说明step 参数可以是正数或负数.step 参数值决定循环的执行情况,如下所...第二个我看的懂答案是s=0,第一个不晓得为什么也是S=0步长为 负数 时counter >= end才会执行循环体。for i = 1 to 5 step -11>=5是不成立的,所以不会进入循环体,那么s=0
推荐
- ..Dim a() a=Array(1,3,5,7,9) s=0 For i=1 To 4 s=s*10+a(i) Next i Print s 为啥答案是3579
- Dim a, i% a=array(1,2,3,4,5,6,7) For i =Lbound(a) to Ubound(a) a(i)=a(i) *a(i) next i print a(i)
- 下列程序段的执行结果为 dim a(5) for i=1 to 5 a(i)=i*i next i print a(i-1) A) 5 B) 25 C) 0 D) 16
- dim a(10,10) as integer for i=1 to 10 for j=1to 10 a(i,j)=i*j next j,i print a(2,2)+a(3,3)
- s=0 For i=1 to 10 step 2 s=s+i Next Print s
- what a bad weather we are having .we've never had so rainy days.改错
- (3.14×7.42+2.58×3.14)÷(3.25+3.14-31/4).
- 摇动的近义词
猜你喜欢