def sortNum(): N =int(input("请输入数组的个数:")) i=0 str_num=[] while i<N: num=input(‘请输入第%d数值‘ %(i+1)) str_num.append(num) i=i+1 str_num.sort() return str_num print(sortNum())
时间: 2024-10-09 23:33:57
def sortNum(): N =int(input("请输入数组的个数:")) i=0 str_num=[] while i<N: num=input(‘请输入第%d数值‘ %(i+1)) str_num.append(num) i=i+1 str_num.sort() return str_num print(sortNum())