下面的程序代码,运行结果为:( )。i=1sum=0While i<;=100sum=sum+ii=i+1print(sum) A: 0 B: 5050 C: 100 D: 1
下面的程序代码,运行结果为:( )。i=1sum=0While i<;=100sum=sum+ii=i+1print(sum) A: 0 B: 5050 C: 100 D: 1
i=sum=0whilei<=4:sum+=ii=i+1int(sum)代码输出的结果是: A: 0 B: 10 C: 4 D: 以上结果都不对。
i=sum=0whilei<=4:sum+=ii=i+1int(sum)代码输出的结果是: A: 0 B: 10 C: 4 D: 以上结果都不对。
下列VBA程序段的执行结果为__________。I=1DoWhileI<=10SUM=SUM+II=I+1LoopDebug.PrintSUM(2.0分)
下列VBA程序段的执行结果为__________。I=1DoWhileI<=10SUM=SUM+II=I+1LoopDebug.PrintSUM(2.0分)
以下(I)和(II)中的两个语句是否产生相同的sum值?(I):for(inti=0;i<;10;++i){sum+=i;}(II):for(inti=0;i<;10;i++){sum+=i;} A: Yes B: No
以下(I)和(II)中的两个语句是否产生相同的sum值?(I):for(inti=0;i<;10;++i){sum+=i;}(II):for(inti=0;i<;10;i++){sum+=i;} A: Yes B: No
def func(): global sum sum=0 print(sum) for i in range(5): sum+=1 print(sum) func() print(sum)
def func(): global sum sum=0 print(sum) for i in range(5): sum+=1 print(sum) func() print(sum)
阅读下面代码,判断正误sum = 0i = 1while i<;10: sum = sum + i i = i +1print "sum is ", sum
阅读下面代码,判断正误sum = 0i = 1while i<;10: sum = sum + i i = i +1print "sum is ", sum
将下面的for循环转换为while循环,补全代码。 long sum=0; for(inti=0;i<=100;i++) sum=sum+i; System.out.println("sum="+sum); 改写成: long sum=0; ① ; while( ② ){ sum=sum+i; ③ ; } System.out.println("sum="+sum);
将下面的for循环转换为while循环,补全代码。 long sum=0; for(inti=0;i<=100;i++) sum=sum+i; System.out.println("sum="+sum); 改写成: long sum=0; ① ; while( ② ){ sum=sum+i; ③ ; } System.out.println("sum="+sum);
System.out.println("sum:"+sum);为输出sum的值。
System.out.println("sum:"+sum);为输出sum的值。
哪一项能产生A型血和B型血后代:() A: II×Ii B: Ii×Ii C: ii×II D: II×II
哪一项能产生A型血和B型血后代:() A: II×Ii B: Ii×Ii C: ii×II D: II×II
在下列程序段中,不能计算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
在下列程序段中,不能计算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