以下程序的运行结果为:( ) 。s = 0for i i...: print(s)
15
举一反三
- 有如下程序段:s = 0For i = 1 To 10 s = s + iNext iPrint s与上述程序段输出结果相同的程序段为( )。 A: s = 0: i = 0 While i <= 10 i = i + 1 s = s + i Wend Print s B: s = 0: i = 1 While i < 10 i = i + 1 s = s + i Wend Print s C: s = 0: i = 1 Do s = s + i i = i + 1 Loop While i < 10 Print s D: s = 0: i = 1 Do s = s + i i = i + 1 Loop Until i > 10 Print s
- 执行下列程序段后,程序的运行结果为()。 s = 1 For i = 1 To 3 For j = 0 To i - 1 s = s + s * j Next j Print s; Next i
- 下列程序中输出结果为5050的是 A: s=0for i in range(100,-1): s=s+iprint(s) B: s=0for i in range(100,1,-1): s=s+iprint(s) C: s=0for i in range(100): s=s+iprint(s) D: s=0for i in range(101): s=s+iprint(s)
- 下列程序段的运行结果为()。 Dim a Dim s%, i% a = Arra...) ^ 2 Next i Print s
- 程序如下 s=0 for i in range(1, 11): s=s+i i=i+1 print(s, i) 程序运行结果s和i的值分别是 A: 50,12 B: 55,10 C: 55,11 D: 50,10
内容
- 0
s = {1,2,3}[br][/br] for i in s: print(i,end='') print() 以上程序输出结果为( )
- 1
运行下列程序,单击窗体显示的结果为( )。 Private Sub Form_Click() Dim a Dim s As Integer, i As Integer a = Array(1, 2, 3) For i = 2 To 0 Step -1 s = s + a(i) * a(i) Next i Print s End Sub
- 2
请写出如下程序的执行结果。s = 0for i in ran... s = s + iprint(s)
- 3
下面程序段的运行结果为____:inti=0,a=0,s=1;do{a=a+s*i;s=-s;i++;}while(i<10);cout<
- 4
阅读程序,输出结果: s=0 for i in range(1,101): s = s + i print('1+2+3+…+100 = ', s)