下面代码的输出结果是(
) a = [9,6,4,5] N = len(a) for i in range(int(len(a) / 2)):
a[i],a[N-i-1] = a[N-i-1],a[i] print(a)[/i][/i]
A: [5,4,6,9]
B: [5,6,9,4]
C: [9,6,5,4]
D: [4,5,6,9]
) a = [9,6,4,5] N = len(a) for i in range(int(len(a) / 2)):
a[i],a[N-i-1] = a[N-i-1],a[i] print(a)[/i][/i]
A: [5,4,6,9]
B: [5,6,9,4]
C: [9,6,5,4]
D: [4,5,6,9]
举一反三
- 下面代码的输出结果是 a<br/>= [9,6,4,5] N<br/>= len(a) for<br/>i in range(int(len(a) / 2)): a[i],a[N-i-1]<br/>= a[N-i-1],a[i] print(a)[/i][/i] A: [9,6,5,4] B: [5,6,9,4] C: [5,4,6,9] D: [9,4,6,5]
- 以下程序的输出结果是___________。for i in range(1,11): print(i, end = " ") A: 1 2 3 4 5 6 7 8 9 B: 1 2 3 4 5 6 7 8 9 10 C: 1 2 3 4 5 D: 1 3 5 7 9
- 下面程序运行后,输出结果是( )。#include ;main( ){ int a[10]={1,2,3,4,5,6},i,j; for(i=0;i { j=a[i];a[i]=a[5-i];a[5-i]=j;} for(i=0;i}[/i][/i] A: 1 5 4 3 2 6 B: 1 5 3 4 2 6 C: 6 5 4 3 2 1 D: 1 2 3 4 5 6
- 以下程序段实现的输出是()。for(i=0;i<;=9;i++)s[i]=i;for(i=9;i>;=0;i--)printf("%2d",s[i]);[/i][/i] A: 9 7 5 3 1 B: 1 3 5 7 9 C: 9 8 7 6 5 4 3 2 1 0 D: 0 1 2 3 4 5 6 7 8 9
- 运行以下程序输出的结果是:( )。i=10while i>;=6:i=i-1if i%4==0:continueelse:print(i,end=' ') A: 10 9 8 7 6 B: 9 8 7 6 5 C: 10 9 7 6 D: 9 7 6 5