摘要: 给定一个数组,有正数,负数和零,排列给定的数组,使负数在左边,0在中间,正数在右边。 let ar = [-1, 2, 0, -5, 0, 8, -4];function swap(a, b) { let c; c = ar[a]; ar[a] = ar[b]; ar[b] = c;}functio 阅读全文
posted @ 2020-03-07 14:13 逸_风 阅读(1464) 评论(0) 推荐(0) 编辑