153.有如下Python程序段: s=“China“;t=[1,3,2];res=“” for i in range (len(s)): m=t[i% len(t)] n=ord(s[i])+m res=res+chr(n) print (res) 運(yùn)行該程序段后,輸出的結(jié)果是( )
(順序查找/對(duì)分查找)。 Dim a(1to 500)as string‘用于存放參加考試學(xué)生的身份證號(hào)碼 Dim s(1to 500)as single‘用于存入?yún)⒓涌荚噷W(xué)生的總分成績(jī) ‘form_load 過(guò)程用于進(jìn)行一些初如化準(zhǔn)備工作 Private Sub form_load ( ) ‘將參加此次考試學(xué)生的身份證號(hào)碼存放在數(shù)組a中 ‘將參加此次考試學(xué)生的總分成績(jī)存放在數(shù)組s中 For i=1to 499‘利用排序法將學(xué)生成績(jī)進(jìn)行降序排序 For j=500to i+1step-1 If ① then t=s(j):s(j)=s(j-1):s(j-1)=t t=a(j):a(j)=a(j-1):a(j-1)=t End If Next j ② End sub ‘command1_click過(guò)程用于查詢(xún)學(xué)生的總分成績(jī)及排名 Private sub command_click ( ?。?br />Dim,bank as integer‘bank為排名 Dim index as Boolean‘index為查詢(xún)憑證 Dim hm as string’hm為身份證號(hào)碼 hm=text1.text index=false For i=1to 500 If hm=a(i) then index=true:bank=i:exit for‘代碼exit for的作用為退出for循環(huán) Next i If index=true then Text2.text=str(s(bank)) Text3.text=str(bank) Else Msgbox (“無(wú)此身份號(hào)碼”) End if。