J = 10 For I = 1 To J Step 5 I = I + 2 J = J - I Next I Print I Print J
结果咋是15 和-3呢,要详细的哈,3Q3Q
人气:460 ℃ 时间:2020-02-04 13:38:36
解答
j=10
for i= 1 to j step 5
i=i+2
j=j-i
next
第一次 循环 i=1 i=i+2就是 i=1+2=3
j=10 j=j-i 就是j=10-3=7
第二次循环 i=3加个步长5 i=8
i=i+2 就是 i=8+2 =10
j=7 j=j-i 就是 j=7-10=-3
第三次 i=10 加个步长5 i=15 超过最大值退出循环
结果i=15 j=-3
推荐
猜你喜欢
- Not both you and i are tired just give up too
- Look at the picture.(改为否定句)___ ____at the picture.
- all these five people plan to take a trip on vacation but can't decide where to go.英语阅读理解
- perception与insight在英语中有什么区别?
- 求VB编程代码(For循环).题目:求Fibonacci数列:1,1,2,3,5,8,…的前40个数
- the,bird,where,yeIIow,is怎么组成英语句子
- 急求五年级数学口算(分数)600道·!
- 请问这是什么表面处理(Fe/Ep.Cu5Ni10 )