L = [1,-2,3,7,-8,-9,10]
j=len(L)-1
i = 0
k = 0
while i<j:
while L[i]>0:
i=i+1
while L[j]<0:
j=j-1
if i<j:
k = L[i]
L[i]=L[j]
L[j] = k
print(L)
For i = 1 To 3
For j = 1 To 6 - i
If a(j) > a(j + 1) Then t = a(j): a(j) = a(j + 1): a(j + 1) = t
Next j
Next i
数组元素 a(1)到 a(6)的数据依次为“55,31,19,42,37,23”,则此程序运行完成后数组元素的数据依次是 ( )
i = 1: j = 10
x = Int(Rnd * 50) * 2 + 1
Do While i <= j
m = (i + j) \ 2
If x = f(m) Then Exit Do
If x < f(m) Then
j = m - 1
Else
i = m + 1
s = s + Str(m)
Loop
数组元素f(1)到f(10)的值依次为:3,6,9,11,18,20,25,39,76,98,该程序运行后,s的值不可能的是( )
①用数码摄像机拍摄美丽风景 ②用扫描仪获取课本上的文章
③用PhotoShop处理拍摄的照片 ④跟好友在网络上进行语音聊天
a=[ ]
for i in range(5):
a.append(i*i)
s=a[3]+a[4]
print (s)
运行结果:
可以发现每个汉字的内码是2个字节。