J = 10 For I = 1 To J Step 5 I = I + 2 J = J - I Next I Print I Print J结果咋是15 和-3呢,要详细的哈,3Q3Q

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 03:36:07
J=10ForI=1ToJStep5I=I+2J=J-INextIPrintIPrintJ结果咋是15和-3呢,要详细的哈,3Q3QJ=10ForI=1ToJStep5I=I+2J=J-INextIP

J = 10 For I = 1 To J Step 5 I = I + 2 J = J - I Next I Print I Print J结果咋是15 和-3呢,要详细的哈,3Q3Q
J = 10 For I = 1 To J Step 5 I = I + 2 J = J - I Next I Print I Print J
结果咋是15 和-3呢,要详细的哈,3Q3Q

J = 10 For I = 1 To J Step 5 I = I + 2 J = J - I Next I Print I Print J结果咋是15 和-3呢,要详细的哈,3Q3Q
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

For j = 10 To i + 1 Step -1 j=0 for i=1 to 10 j=j+i Next print j 请画出此程序的流程图并写出j的值 For i = 1 To 10 f = True For j = 1 To 9 If a(j) > a(j + 1) Then t = a(j) a(j) = a(j + 1) a(j + 1) =For i = 1 To 10f = TrueFor j = 1 To 9If a(j) > a(j + 1) Thent = a(j)a(j) = a(j + 1)a(j + 1) = tf = FalseEnd IfNext jIf f ThenExit ForEnd IfNext i其中 for(j=i+1;j for i=1 to 10 i=i+i j=j+1 next print i,j请问结果是什么?结果是15 J = 10 For I = 1 To J Step 5 I = I + 2 J = J - I Next I Print I Print J结果咋是15 和-3呢,要详细的哈,3Q3Q Var a:array[1..10]of integer; j,i:integer; begin a[i]:=a[i]+i; for j:=1 to i do a[j]:=a[i]+j; .Var a:array[1..10]of integer; j,i:integer; begin a[i]:=a[i]+i;for j:=1 to i do a[j]:=a[i]+j;end;for i:=1 to 10 do write(a[i],' ');eod. 下列程序的执行结果为().dim a(10),b(5) for i=1 to 10 a(i)=i next i for j=1 to 5 b(j)=j*20 next j for(i=1;i<10;i++){for(j=1;j<=i;j++)解释一下这是什么意思? 下面程序段运行后 for i=1 to 5 for j=2 to i print*;next j next i 为什么结果是10个“*” 2个矩阵相加,For i = 1 To 4For j = 1 To 4c(i,j) = a(i,j) + b(i,j)Picture3.Print c(i,j);If i = 1 And j = 1 ThenMax = c(i,j)ElseIf Max < c(i,j) Then Max = c(i,j):n = i:m = jEnd IfNext jPicture3.PrintNext i这个和For i = 1 To 4For j = 1 To 4c(i,j) for (j=i 下标越界dim .for i = 1 to 7for j = 1 to 7 if i = 1 or j = 1 then a(i,j)=1elsea(i,j) =a(i-1,j-1)+a(i-1,j)end ifnext j next ifor i= 1 to7for j= 1 to iprint a(i,j)next j printnext i .运行说是下标越界 a(i,j) =a(i-1,j-1 FOR循环次数的计算j=0for i=1 to 10j=j+1Nextprinit j请你算出 j=? 并画出流程图能不能把计算过程也说明一下 谢谢 Dim j%,i%,m% m = 0 For i = 1 To 3 For j = 1 To i m = m + j Next j,i Text1 = Str(m)最后m j 是多少 Dim x(3,5) As Integer For i = 1 To 3 For j = 1 To 5 x(i,j) = x(i - 1,j - 1) + i + j Next j Next iprint (3,4) SET TALK OFF CLEAR FOR I=1 TO 20 FOR J=1 TO 33 FOR K=(100-I*5-J*3)*3 IF I=J=K=100 I,J,K ENDIF ENDFOK=(100-I*5-J*3)*3 提示语法错误SET TALK OFFCLEARFOR I=1 TO 20FOR J=1 TO 33FOR K=(100-I*5-J*3)*3IF I=J=K=100I,J,KENDIFENDFORENDFORENDFORSET TALK ON for (i=1,j=10;i