当前位置: 高中信息技术 / 单选题
  • 1. (2022·杭州模拟) 有如下Python程序:

    import random

    s1="AsiaGames"; s2=[]; s3=""

    n=len(s1); i=0

    while i<n:

        if random. randint (0, 1)==0:

            if len(s2)==0 or s1[i]>s2[-1]:

                 s2. append(s1[i])

            i+=1

        else:

            if len(s2) >0:

                 s3+=s2. pop(-1)

    while len(s2)>0:

        s3+=s2. pop(-1)

    print (s3)

    执行该程序,则输出结果不可能是(    )

    A . saAsm B . sAise C . sAiaGmsea D . AsiaGames

微信扫码预览、分享更方便