2014年面试题
2016-01-20 10:52
302 查看
local count = 0
local mode = 5
function go(index,str,jk)
str = str ..(jk==0 and "" or jk)
if index <= 0 then
if string.sub(str,3,3) ~= "3" then
count = count + 1
print(str)
end
return
end
for i = 1,mode do
if not string.find(str,i) and jk+i~=6 then
go(index-1,str,i)
end
end
end
go(5,"",0)
print(count)
local mode = 5
function go(index,str,jk)
str = str ..(jk==0 and "" or jk)
if index <= 0 then
if string.sub(str,3,3) ~= "3" then
count = count + 1
print(str)
end
return
end
for i = 1,mode do
if not string.find(str,i) and jk+i~=6 then
go(index-1,str,i)
end
end
end
go(5,"",0)
print(count)
相关文章推荐
- 10个经典的Java main方法面试题
- 面试时绝对不能说的 10 句话
- 程序员什么时候该考虑辞职?
- iOS开发-你能用到的面试题
- 程序员一年工作经验之谈
- 程序员一年工作经验之谈
- 程序员一年工作经验之谈
- 程序员一年工作经验之谈
- 高效程序员的45个习惯の对事不对人
- 面试经历---UC(2016年01月11日下午面试)
- 机器学习导论
- 有些开发经验的程序员去学android (一)
- Java 程序员必去的网站
- 2015年4月腾讯校招实习生(后台开发)面试经验(一面二面三面)
- 2015小米校招【研发类】面试真题经验分享
- leetcode之Lowest Common Ancestor of a Binary Search Tree
- 2014百度校园招聘面试题
- 百度2015校园招聘面试题
- leetcode之Odd Even Linked List
- leetcode之majority number