Re: [問題] 1-9位數不重複印出來 (LiveScript)

看板Programming作者 (四元)時間7年前 (2016/11/26 14:48), 7年前編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
# 可以貼在 http://livescript.net/ 跑跑看 num = 2 # Enter a number for i in [1 to 10**num - 1] i if not /(\d).*\1/.exec i |> join ', ' ※ 引述《mikemagic88 (Mikemagic88)》之銘言: : 使用者輸入1 印1-9 : 使用者輸入2 印1-98 (11, 22, 33等重複的不印) : 使用者輸入3 印1-987 (121, 988, 667等有重複的不印) -- Ubuntu 正體中文社群 https://plus.google.com/u/0/communities/110616242117472323622 Ubuntu 正體中文社團 https://www.facebook.com/groups/ubuntu.zh.hant/ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.227.56.142 ※ 文章網址: https://www.ptt.cc/bbs/Programming/M.1480142924.A.5A5.html ※ 編輯: fourdollars (1.163.117.89), 11/28/2016 19:28:05

11/29 01:10, , 1F
/(\d).*\1/ 太酷了!
11/29 01:10, 1F
※ 編輯: fourdollars (1.163.117.89), 11/29/2016 12:34:13
文章代碼(AID): #1OEJ1CMb (Programming)