def func(s, i, j): if i < j: func(s, i + 1, j - 1) s[i],s[j] = s[j], s[i] def main(): a = [10, 6, 23, -90, 0, 3] func(a, 0, len(a)-1) for i in range(6): print a[i] print "\n" main()
30‐9023610
30‐6023610
61030‐9023
61030-2323
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题