使用 while 循环实现输出 1 2 3 4 5 7 8 9 11 12,请补充程序i = 1while i <13: if i == 6 or i == 10: i=i+1 ________ __ else: print(i,end=' ') i = i+1
举一反三
- 以下代码符合MATLAB语法的是( ) A: for i=1:10i++end B: While (i<10)i=i+1;end C: while (i<10){i=i+1;} D: for i=1:10iend
- 下列程序输出结果是( )。 i=1 s=0 while i<=3: s=s+i i=i+1 print(s) A: 1 B: 3 C: 6 D: 9
- 下面的代码,哪些是输出1,2,3三个数字 ( )。 A: for i in range(3): print(i) print(i+1) B: aList = [0,1,2] for i in aList: print(i+1) C: i = 1 while i < 3: print(i) i+=1 D: for i in range(3): print(i+1)
- 7.2(中)下面程序的运行结果是: i = 1 while i < 10: print(i) i=i+1
- Public Sub Proc(a%( )) Static i% Do a(i) = a(i) + a(i + 1) i = i + 1 Loop While i < 2 End Sub Private Sub Command1_Click( ) Dim m%, i%, x%(10) For i = 0 To 4: x(i) = i + 1: Next i For i = 1 To 2: Call Proc(x): Next i For i = 0 To 4: Print x(i);: Next i End Sub A: 3 4 7 5 6 B: 3 5 7 4 5 C: 2 3 4 4 5 D: 4 5 6 7 8