摘要:
1 -- 克隆 2 function Clone(object) 3 local lookup_table = { } 4 local function _copy(object) 5 if type(object) ~= "table" then 6 return object 7 elseif 阅读全文
摘要:
如图所示: C#代码: 1 using System.Collections; 2 using System.Collections.Generic; 3 using UnityEngine; 4 5 public class SpriteRendererTest : MonoBehaviour { 阅读全文
摘要:
1 function bubbleSort(t) 2 local index = 0 3 for i=1, #t - 1 do 4 for j = 1, #t - i do 5 if t[j] > t[j + 1] then 6 t[j],t[j + 1] = t[j+1], t[j] 7 end 阅读全文
摘要:
有n盏灯,编号为1~n。第一个人把所有灯打开,第二个人按下所有编号为2的倍数的开关(这些灯将被关掉),第三个人按下所有编号为3的倍数的开关(其中关掉的灯将被打开,开着的灯将被关闭),依此类推。一共有k个人,问最后有哪些灯开着?输入n和k,输出开着的灯的编号。k<=n<=1000 1 function 阅读全文