Lua冒泡排序

num3={10,20,1,2,3,5,6,2,3,4}
-- -- z=0;
-- -- for  i=1,#num3  do
-- --          local x = 1
-- --          for  j=1, #num3-i  do
-- --             if  num3[j]>num3[j+1]  then
-- --                 z=num3[j+1]
-- --                 num3[j+1]=num3[j]
-- --                 num3[j]=z
-- --                 x=2
-- --             end
-- --          end
-- --          if  1==x then
-- --           break
-- --          end
-- -- end

猜你喜欢

转载自blog.csdn.net/qq_41939248/article/details/80401125